• TwitterFacebookGoogle PlusLinkedInRSS FeedEmail

Raspberry Pi Serial Port Uartsy

With the kit you should have received a pamphlet with some very stylish soldering instructions (thanks SparkFun artsy-fartsy department!). If you're having trouble finding your FTDI's COM port, try unplugging it, checking the Serial Port list, plugging the FTDI board back in and scanning the Serial Port list for.

This problem is quite complicated. Seemingly I have simple two-way communication beetwen 2 devices where reading side is Raspberry pi 3. I'm trying to transfer file.

Raspberry Pi Serial Connection

I'm sending it part by part (5kb part). Nba 2k13 Demo Xbox 360. It looks like: 1) Sending side send first 5kb part (exactly 5136 bytes where first 16 bytes are ID/SIZE/ADD_INFO/CRC) 2) RPi3 read 5136 bytes, and calculate CRC for chunk. 3) RPi3 compare CRC received from sending side and calculated by RPi 4a) If CRC doesn't match I switch lanes from RX to TX line using Dual Bus Buffer Gate With 3-State Outputs and set High State at TX line (I keep it for 30ms).

4b) If CRC match I just wait for next chunk of file 5) Sending side switch lanes too and read my TX state if state is HIGH/1 (when CRC doesn't match) it sends same chunk (retransmission) if state is LOW/0 sends another chunk. (changing state take 10 ms) On osciloscope it looks like this (4a): and this (4b): Beetwen 5136 chunk there is free time to calculate CRC then we have on RPi3 side changing state if we have to because CRC doesn't match (red lines at 4a) and reading TX side from Sending side. Ok now some simplified code from RPi: def recv(): while True: #Set line to low because I want to read data GPIO.output(16, GPIO.LOW) ID = ser.read(4) SIZE = ser.read(4) ADD_INFO = ser.read(4) CRC = ser.read(4) #get crc from sending side crc_chunk = int.from_bytes(CRC, byteorder='little') data = ser.read(5120) #calculating CRC from chunk rpiCRC = crcSTM(data) while True.