embeded/raspberry pi2017. 3. 25. 15:36

라즈베리 완전체(?) 햇을 만들려고 하다가 망했어 ㅠㅠ


점퍼 연결해서 쓰기 귀찮아서

대충 만능보드 이용해서 만들려고 하다가 또 실패인가...

아무튼 DHT-11은 노릇노릇하게 익어버렸고

머가 문제인지 멘붕..

다행히도 라즈베리 쪽은 손상이 없는거 같긴한데

가속도 센서 / 초음파 거리 센서는 살아있는지 확인을 해야 할 듯 ㅠㅠ




DHT-11 센서 분해하니 안쪽에 이런식으로 온도/습도 센서 부분이 있고

여기를 자세히 보면 강우 센서가 아주 미세한 모양을 한것 처럼 중앙 부분에 있다.


뒤에는 하나도 안써있어서 무슨 칩인지 알수 없으나.. 마이컴이 아닐까 생각된다.


태워먹고는 멘붕와서 만든 보드도 확 버려 버릴까 고민 ㅠㅠ

'embeded > raspberry pi' 카테고리의 다른 글

레트로 파이.. 준비(?)  (0) 2017.08.07
rpi pwm markspace balanced mode waveform  (0) 2017.06.29
라즈베리 파이 포트 요약  (0) 2017.03.25
라즈베리 파이 gpio sysfs  (0) 2017.02.15
라즈베리 파이 + 태양전지!  (0) 2017.01.25
Posted by 구차니

비싼돈(?) 주고 MFI 인증 받은걸 사도..

컴퓨터 메인보드 USB 전원으로 iPad 충전하기에는 부족했나

퍽퍽나가네.. ㅠㅠ


얘는 예전에 사은품으로 받은 2500mA 보조배터리에 있던 비인증 어댑터

단순한 구조인데 칩이 하나 나갔는지 반대방향으로는 충전이 잘 안되서 일단 버림



거금(!)을 들여서 구매한 어댑터 근데 한달도 못 쓴 듯...



분해가 잘 안되서 낑낑대면서 잘라내고 그러다 보니 -_-

아무튼 고무재질로 확실히 감싸고 USB 커넥터 쪽도 금속으로 되어 있어서

확실히 위에 녀석보다 비쌀수 밖에 없는 구조.

그런데 나가는건 똑같네..


아.. 그러고 보니 칩이 얘는 하나고 비인증은 2개가 달려있네?

(가격은 비인증 700원 인증 3500원 이었나?)


Posted by 구차니
embeded/raspberry pi2017. 3. 25. 13:11

예전에 iot로 검색해서 보다 보니 귀찮고 헷갈려서 다시 정리

PWM은 2개 포트뿐이니.. 동시에 두개가 한계겠네..




rpi.pdf


Posted by 구차니
embeded/Cortex-M3 Ti2017. 3. 24. 10:58

얘랑은 좀 다른 이야기인데...

rs232 to rs485로 쓰다 보니

485쪽은 TXEN 하면 RX쪽이 Hi-Z로 설정되면서

아마도 0x00으로 들어 오는 듯?


그리고 driverlib에도 RX만 disable 시키는 건 없으니

함수를 하나 만들어서 RX만 disable enable을 시켜서 일단 우회

void

UARTDisable(uint32_t ui32Base)

{

    //

    // Check the arguments.

    //

    ASSERT(_UARTBaseValid(ui32Base));


    //

    // Wait for end of TX.

    //

    while(HWREG(ui32Base + UART_O_FR) & UART_FR_BUSY)

    {

    }


    //

    // Disable the FIFO.

    //

    HWREG(ui32Base + UART_O_LCRH) &= ~(UART_LCRH_FEN);


    //

    // Disable the UART.

    //

    HWREG(ui32Base + UART_O_CTL) &= ~(UART_CTL_UARTEN | UART_CTL_TXE |

                                      UART_CTL_RXE);


일단 정석(?)적인 해결책은 RX에 pull-up을 달아 주는 것

[링크 : https://e2e.ti.com/support/microcontrollers/stellaris_arm/f/471/t/45318]


OD나 PUD 안먹더라니, 직원이 push-pull로 작동한다고 하면 그런거겠지? ㅠㅠ

[링크 : https://e2e.ti.com/support/microcontrollers/stellaris_arm/f/471/t/88669]



9.2.2.27 GPIOPinTypeUART

Configures pin(s) for use by the UART peripheral.

Prototype:

void

GPIOPinTypeUART(unsigned long ulPort,

unsigned char ucPins)

Parameters:

ulPort is the base address of the GPIO port.

ucPins is the bit-packed representation of the pin(s).

Description:

The UART pins must be properly configured for the UART peripheral to function correctly. This

function provides a typical configuration for those pin(s); other configurations may work as well

depending upon the board setup (for example, using the on-chip pull-ups).

The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to

be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO

port pin 1, and so on.

Note:

This cannot be used to turn any pin into a UART pin; it only configures a UART pin for proper

operation. 


Posted by 구차니
embeded/Cortex-M3 Ti2017. 3. 23. 14:21

uart의 baudrate를 설정해주는 녀석은

내부적으로 UARTDisable()과 UARTEnable()을 포함하는데

UARTEnable()은 fifo enable을 포함한다.(얘가 악의 축)


그리고 UARTDisable()은 TX 할게 있으면 다 보낼때 까지 기다려주는 역활을 한다.



void

UARTConfigSetExpClk(uint32_t ui32Base, uint32_t ui32UARTClk,

                    uint32_t ui32Baud, uint32_t ui32Config)

{

    // Stop the UART.

    UARTDisable(ui32Base);


    // Set the baud rate.

    HWREG(ui32Base + UART_O_IBRD) = ui32Div / 64;

    HWREG(ui32Base + UART_O_FBRD) = ui32Div % 64;


    // Set parity, data length, and number of stop bits.

    HWREG(ui32Base + UART_O_LCRH) = ui32Config;


    // Clear the flags register.

    HWREG(ui32Base + UART_O_FR) = 0;


    // Start the UART.

    UARTEnable(ui32Base);


void

UARTEnable(uint32_t ui32Base)

{

    //

    // Check the arguments.

    //

    ASSERT(_UARTBaseValid(ui32Base));


    //

    // Enable the FIFO.

    //

    HWREG(ui32Base + UART_O_LCRH) |= UART_LCRH_FEN;


    //

    // Enable RX, TX, and the UART.

    //

    HWREG(ui32Base + UART_O_CTL) |= (UART_CTL_UARTEN | UART_CTL_TXE |

                                     UART_CTL_RXE);

}


void
UARTDisable(uint32_t ui32Base)
{
    //
    // Check the arguments.
    //
    ASSERT(_UARTBaseValid(ui32Base));

    //
    // Wait for end of TX.
    //
    while(HWREG(ui32Base + UART_O_FR) & UART_FR_BUSY)
    {
    }

    //
    // Disable the FIFO.
    //
    HWREG(ui32Base + UART_O_LCRH) &= ~(UART_LCRH_FEN);

    //
    // Disable the UART.
    //
    HWREG(ui32Base + UART_O_CTL) &= ~(UART_CTL_UARTEN | UART_CTL_TXE |
                                      UART_CTL_RXE);
}



근데 도대체!!! 뒤에 0x00은 왜 붙는거야?

Posted by 구차니
프로그램 사용/sqlite2017. 3. 23. 13:36

쿨 메신저라는 녀석을 백업하면 udb라고 나온다는데

파일 열어 보니 sqllite


그래서 검색을 해보니.. 이거 열어 보는 프로그램이 존재하네?


[링크 : http://sqlitebrowser.org/]

    [링크 : http://aspdotnet.tistory.com/1285]

'프로그램 사용 > sqlite' 카테고리의 다른 글

sqlite primary key  (0) 2019.03.12
sqlite dateime  (0) 2018.11.27
sqlite3 도움말  (0) 2017.04.02
라즈베리 sqlite 버전  (0) 2017.04.02
sqlite  (0) 2013.07.19
Posted by 구차니

/etc/webalizer/webalizer.conf 에 보면 아래 세가지가 보이는데

생각을 해보니.. 이 기능을 이용하면 logrotate를 비활성화 하지 않아도 문제가 될거 없는 느낌?

logrotate를 잠시 꺼둔 이유가 모이지 않아서였는데


history 파일은 이전달들이니까.. 복수형인거 같고

즉, logrotate 당해도 이전 데이터 들은 남아 있다 정도일거 같은데


incremental은 파싱할 내용의 범위를 줄여주는 기능이려나?


 45 # HistoryName allows you to specify the name of the history file produced

 46 # by the Webalizer.  The history file keeps the data for previous months,

 47 # and is used for generating the main HTML page (index.html). The default

 48 # is a file named "webalizer.hist", stored in the output directory being

 49 # used.  The name can include a path, which will be relative to the output

 50 # directory unless absolute (starts with a leading '/')


 54 # Incremental processing allows multiple partial log files to be used

 55 # instead of one huge one.  Useful for large sites that have to rotate

 56 # their log files more than once a month.  The Webalizer will save its

 57 # internal state before exiting, and restore it the next time run, in

 58 # order to continue processing where it left off.  This mode also causes

 59 # The Webalizer to scan for and ignore duplicate records (records already

 60 # processed by a previous run).  See the README file for additional

 61 # information.  The value may be 'yes' or 'no', with a default of 'no'.

 62 # The file 'webalizer.current' is used to store the current state data,

 63 # and is located in the output directory of the program (unless changed

 64 # with the IncrementalName option below).  Please read at least the section

 65 # on Incremental processing in the README file before you enable this option

 

 69 # IncrementalName allows you to specify the filename for saving the

 70 # incremental data in.  It is similar to the HistoryName option where the

 71 # name is relative to the specified output directory, unless an absolute

 72 # filename is specified.  The default is a file named "webalizer.current"

 73 # kept in the normal output directory.  If you don't specify "Incremental"

 74 # as 'yes' then this option has no meaning. 



[링크 : http://se.uzoogom.com/17]

[링크 : http://blog.naver.com/fogwhite/20050962196]



+

그나저나.. 이게 원래 보던건데..


테스트 한다고 access.log 를 비워버리고 webalizer 실행하니까 이렇게 kB In/Out 이라는 못보던 항목이 생겨났다

무슨 옵션으로 인해 생겨난거지?


Posted by 구차니

많이 쓰는게 N-8-1 이니까

1byte 전송에 10bit를 주로 쓰니까 일단 둘다 계산



많이 사용되는(?) 비트레이트 저장

[링크 : http://www.cermetek.com/Catalog/High-Speed-Modems/DataSheet/...CH1794_607-0003/]

Posted by 구차니
embeded/Cortex-M3 Ti2017. 3. 15. 10:07

테스트 코드

19200bps와 38400bps를 오가면서 1바이트씩 보내는 예제


  SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1);

GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1);


while(1)

{

UARTConfigSetExpClk(UART1_BASE, SysCtlClockGet(), 19200, UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE);

UARTCharPut(UART1_BASE,'A');

MDINDLY_mSec(100);

UARTConfigSetExpClk(UART1_BASE, SysCtlClockGet(), 38400, UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE);

UARTCharPut(UART1_BASE,'B');

MDINDLY_mSec(100);

}



근데 도대체.. 예전에는 왜 안되었던 거지??


+

추가로

FIFO 설정은 UARTConfigSetExpClk 에서 무조건 Enable 시키니 주의

Posted by 구차니

약간의 제약이 있긴 하지만

view로 만든 것으로도 insert가 가능하군.


[링크 : http://recoveryman.tistory.com/181]


+

2017.04.07


볼수 있는건 다 뷰로 만들수 있는듯 조인도 되고


[링크 : https://dev.mysql.com/doc/refman/5.7/en/create-view.html]

[링크 : http://stackoverflow.com/questions/12352048/mysql-create-view-joining-two-tables]

'프로그램 사용 > mysql & mariaDB' 카테고리의 다른 글

db에 mac / ip 저장하기(자료형)  (0) 2017.05.09
mysql innodb compress  (0) 2017.04.12
db designer  (0) 2017.03.14
데이터베이스 구조 버전관리  (0) 2017.02.13
mysql 통화관련 변수타입  (0) 2017.02.07
Posted by 구차니