How to send an image using serial port with acoustic modem? - serial-communication

How to convert an image into data bytes to send over series port ? Need to get an image convert the same into data bits which can be transmitter acoustically over channel. i am not sure how to send data serially ? Is there a way to do this ?

You don't mention the language you are using but most languages will have a library to allow you send data via a serial port.
For example in Java there exists, amongst many other examples: http://fazecast.github.io/jSerialComm/

Related

How can I use Protocol Buffers for structuring a third party serial Communication Protocol?

I am working on an ECG module, which is giving out data in bytes. There's a protocol document about it explaining like how to structure the packets, that are coming out of the module.
I want to decode that data.
I am confused whether protocol buffers will help in this or not. Any other methods that would be helpful in this decoding and writing that protocol in Python ?
Protocol buffers only works with its own encoding format.
For decoding a manufacturer-specific custom binary format, I would suggest Python's built-in struct module. Here is a basic tutorial which is easy get started with.
If the manufacturer-specific format is text based instead, you can either use basic string manipulation to split it into tokens, or one of the parsing libraries for Python.

Transfer more than 8 bytes using can-bus on embedded Linux

I have a node on a can-bus that will send out ~1KB data to the other nodes on the can-bus. With the max payload being 8 bytes using CAN protocol what options are available for sending larger amounts without having to write my own custom transmit and receive functions to fragment the data? The nodes are running embedded Linux.
I have very little experience with CAN.
Protocols on top of CAN such as J1939, NMEA2000 and CANopen provide their own ways to do this. So I would say: Find a software stack for another protocol on top of CAN. thanks.

Using data out of the dataset recording mode in Tango

Would it be possible to utilize the data that comes out of the Tango on a computer? I noticed that the datasets that are recorded are just ROS bags, but I'm not sure what the message types contain in each topic. Is there a resource that allows us to access the information contained in the bag?
EDIT: I'm talking about using the key: TANGO_DATASETRCORDING_MODE_ALL (https://developers.google.com/tango/apis/java/reference/TangoConfig.html#TANGO_DATASETRECORDING_MODE_ALL)
I don't know about recording the data on the Tango and exporting the dataset to a computer afterwards, but it's very much possible to stream the data to a .csv file over a WiFi connection.
As a simplified example, in the Tango's onPoseAvailable() callback, you can build a string that contains the x, y and z position of the Tango and fire off an ASyncTask class to write the position string to a WiFi port on your computer. On your computer you can have a simple script listening to that port which then writes whatever it receives into a .csv file. The WiFi write from the Tango's side will be triggered whenever onPoseAvailable() is called so you are effectively streaming the Tango's position in real-time.

QUdpsocket send and receive an image

I want to grab the PC screen. I use QPixmap::grab, and I get a QPixmap. Then I want to send this image using QUdpsocket. The image has been already converted to binary.
http://www.java2s.com/Code/Cpp/Qt/Udpserver.htm 's demo can send and receive the image, but use pixel, I wanna send all binary data each 250ms.
If you want to send the whole image in one go, you could try using QDataStream for serialization of a QByteArray.
The problem with this is that a UDP packet has a limited size, and could get fragmented if too large, and while large packets may work on your LAN, they could get fragmented over the internet. As UDP doesn't provide ordering guarantees like TCP, the fragments could come in the wrong order without the QDataStream header. This is probably why in your linked example they are only sending a single line at a time.
You may want to read a comparison of TCP and UDP and evaluate which fits your needs better.

Ethernet Types 0xBEEF

There is a field in the ethernet header called the ethernet type. I am writing a communication library in windows using raw ethernet frames. What should I do to take the Ethernet type into consideration? The one I must use is 0xBEEF. Does this mean I can't use anything like NDIS?
The best thing to do is to read about EtherType field.
It is used to indicate which protocol is encapsulated in the frame data.
This means that if you use 0xBEEF, other machines running standard software will not recognize the frame's payload.
You can, of course, send any kind of data in the frame. You will merely have to have your software installed on the receiving end to interpret the data.
Ethernet type is basically the type of the protocol of the data that is contained in that particular Ethernet frame .
If there aren't very good reasons for doing so, I would never use raw Ethernet frames. It's usually much simpler and more futureproof to e.g. use UDP packets.

Resources