I'm working on a project where I need to transmit a picture from one Pi to another using serial communication .. it is not possible to send it via the network .. it is required in the project to send the picture serially via Rx and Tx ..

The serial link between the Pis is already working fine and I can send text strings and variable .. but now I need some help on how to write a python script that opens an image file and sends it byte by byte to the other Pi ..

Could anyone help me ?

Regards, Ragy Samy ..

  • 3
    Sounds like a homework question. This is not a Pi problem, use ANY serial protocol. – Milliways Mar 28 at 6:45
  • Hi @Ragy Samy. welcome and nice to meet you. Ah, let me see. You problem is interesting. Let us make the problem as simple as possible, but not simpler. Suppose the picture (image) is very tiny, say only 8 dot (pixel) by 8 dot, = 64 dots each of which is either black or white (monochrome). / to continue, ... – tlfong01 Mar 28 at 7:03
  • Shall we now give a name/number to each of the dot, perhaps couting/scanning from top right corner, direction left to right, so the 8 pixels of the top row can be named by row number and column number as r0c0, r0c1, ... r7c7? Perhaps we can send the picture row by row, each row as one byte. So to send the first row of 8 pixels by serial, we can send on byte, say blk, blk, blk, blk, wht, wht, wht, wht = 0,0,0,1,1,1,1, ... Ah tea time, perhaps you can carry on, my friend, :) cheers. – tlfong01 Mar 28 at 7:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.