Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Binary protocol for DIY projects

Hello.
I am designing my own logger, and I want to use it together with the RC.
As a receiver, I use ublox M8 at 10Hz. There is a similar project on the forum, on Arduino.
I use Stm32F4.
I made the transmission of the signal from the can-bus via Bluetooth, using the RC3 protocol. Everything works, but it does not work very optimally.
It would be great if you could use a binary transfer protocol.
To transfer data from my device now, I need to send 3 text messages (2 GPS and 1 RC3).
At a frequency of at least 10 Hz, this is a fairly large amount of data.
In addition, to form these messages, most often use a function like a "sprintf". This is a standard feature and is very slow. I use a microcontroller with a frequency of 168 MHz, and the delay from the "sprintf" is noticeable. On the popular Arduino with a frequency of 16 MHz, this is even more noticeable.
Microcontrollers have very limited resources, so I would like to do without converting numbers into text. Moreover, the RC probably does the inverse conversion from text to numbers.

As a prototype of the protocol, I propose a binary protocol UBX from Ublox.
It is well documented and thought out, allows you to make packages not fixed length, but the minimum necessary. It could be used as a sample.

For example: at a frequency of 10 Hz, at a uart speed of 57600, only 19% of the possible load is used to transmit messages UBX-NAVPVT (contains all the necessary information about location and speed).

Comments

  • aolaol
    edited October 9
    I've noticed the need for a binary protocol... To save bandwidth on RFCOMM, but also to be able to transmit over BLE, to gain iPhone support. I will need to build new testing equipment, to be able to test the new protocol. I've already ordered hardware for this, but it will need a lot of work - as I will need to build a fully functional device. But hopefully I have time for this during the winter...
Sign In or Register to comment.