RS232 Connection

Starting this topic to document progress on this project.

I had been tasked with creating a unit for human identification for work and got to pick my hardware of choice and landed on a rock5b. Needed higher processing power and RPi4s are a joke these days.

The project has grown and my rock5b, in addition to the previous task, will be used as a logic unit controlling several peripheral items.

One in particular requires an RS232 connection.

I have never done anything like this, so going to be completely new but looking forward to documenting this here and hopefully getting feedback and discussion from the rest of you!

If all goes well and this takes off, I will be in need of over 30 Rock5Bs, LOL. Currently having a blast with this thing, and it’s my first SBC. Likely going to purchase one or two for home use now as well.

2 Likes

Just curious, what is being connected via 3s232? Using a 9 or 25 pin type thing?

Ask any questions you want. Technically 9 pin, but we’ll only be using 3 of them.

As the project progresses, i’ll be talking about it more here. We’re looking to control a piece of hardware made by a company called Mackenzie. It’s known as a DADS-MB701.

That is pretty neat. I have never had to deal with the difference in voltage, but see that thing uses DC Voltage: 24 Volts. Stepping down isn’t a problem, but how are you boosting up on the inverse?

1 Like

We’re still in the planning process but this will all be done on a bus. The MB701 will be powered through the vehicle, and same with the rock5b.

I anticipate the 5b will be a much bigger challenge to keep powered without rebooting, but should be doable.

Alright!

So currently, I have the MB701 powered up, and the RS232 connected within it’s DB50. I have pins 2,3 & 5 connected accordingly.

However, I am currently sending it commands according to the serial protocol outlined by Mackenzie and am getting nothing back.

Alright, I have been able to receive output back, but from one command alone.

Anyone here familiar with serial connections willing to help me understand this documentation? I must be getting the command format incorrectly.

On another note, setting up the connection was quite easy. Armbian immediately recognized the USB-RS232 adapter and once I connected the 2,3 & 5 pins, connection was made.

Progress!

The specifications for sending commands to the MB701 is per this here:

Had some trouble figuring out this format while using PySerial, but seems it works if doing something like this:

serial.to_bytes([0xA5, 0xA5, 0x00, 0x00, 0x24, 0x64, 0xE6, 0x5A, 0x5A])

So I now have messages playing, need to work on controlling sign text through the box. Only issue is now I cannot seem to pass it the only two commands that are pure ASCII (DDIR, FIRMWARE). I believe this is because PySerial requires bytes to be passed and plan ASCII errors out.

Another roadblock is the CRC16 portion of the command. The information i’ve found on calculating it is sparse but I seem to be doing it correctly.

Anyone here familiar with the YMODEM protocol?

I’m using lrzsz to attempt to send a .mp3 file over the serial connection. So far, I get 133 bytes and then the transmission fails at “No ACK on EOT”. The .mp3 is roughly 17000 bytes…