Interpreting serial communications from a LED program

I’m trying to get the serial communication that goes from my LED software on my laptop to the LED sign so I can use it through a raspberry pi, bypassing the LED software. The LED sign uses RS485 and the software is LedCentreM6.00. I’m using a USB-to-RS485 by Waveshare (Industrial USB to RS485 Converter | Buy in Australia | WS-17286 | Waveshare | Core Electronics) to go from the laptop to the sign. The software is not Linux compatible. The laptop I using is running Windows 10. The baud rate of the sign is 115200. The sign using Hexadecimal.

I’m not sure how to use PuTTY as you can’t use it to sniff a port (say COM7) if it is being used by another program.

I thought maybe using HxD to interpret the *.lpp, *.lpl, and *.rsf files that come from the software that should contain the serial instructions I need. I haven’t tried this yet, as I need IT to install programs here at work - I don’t have admin authority.

Anyone have any other ideas, or could add to my suggestions to make it work?

1 Like

Hey @Rob284232,

Before we can suggest a good way to get your Raspberry Pi talking to the LED sign, it would help to have a bit more information:

  • Which LED sign model are you using, and what interface does it use (USB, RS232, TTL)?
  • What operating system does the PC software run on?
  • Do you have any possibility of installing software, or using another machine to help with this?
  • Do you know the baud rate and other serial settings used by the LED software?

Once we have these details, we can suggest some options.

Checkout Portmon by SysInternals. They were bought by Microsoft so it’s official Microsoft software now. Should help with sniffing the serial communications.

I just edited my initial post Ryan.

RS485 is more the physical layer sends the serial data. As already mentioned, their will be the comm port settings.
I would use a from of logic analyzer, something like

should be ok (just need to check the RS485 voltage levels v the max input voltage to the analyzer (that one looks to be 5.25V max).

this will give you the full “RS485” bits either correct or inverted (depending on which pin you monitor and the analyzer software decoder settings.

So, if you have 9600 Bps, 8 Data bits 1 start 1 stop and no parity, then you would see 10 bits per byte sent, and the decoder should be able to output the raw bytes.

While you can get software port monitors for different OS, it means its locked to devices that connect to that PC, a logic analyzer is also nice to have when debugging lots of things.

edit
Example of that analyzer and pulseview (free software)


The last two bytes, so with a little coding, you could stripe out just the data hex.

1 Like

Would this wiring work with PuTTY?

In theory something like that can work. Just keep in mind that the comms may or may not be text based, so when logging you will want to save “all session output” and may need to view in a binary/hex editor.
You will need to ensure the comms settings are the same.
RS485 is half duplex, so the same wire is used for TX and RX, so if the comms is bi-directional, it may take some analysis to work out the back n forth…

1 Like

Rob,

I’m trying to see the bigger picture..

You have a display panel that uses a Windows program called LedCentre to control it.

You want to do some thing that the software does not provide, although I found a manual for LedCentre and it looks quite comprehensive.

so…

Can you explain further what you want to do e.g. display some different graphics not available in the software?

Can you work with the Software Developer to add features or are you trying to replace it ?

Have you looked up the details of the display panel to see what commands it uses? Often devices have a FCC registration that will point you to the OEM or some more technical information. Can you open the display and see what control board it uses?

Dave

I’m trying to use the Rpi to send the sign ‘instructions’ without the software. Eventually creating an app for the sign that allows the user to open a road or close a road at the push of a button. First step it getting the Rpi (which will be the middleman between the modem and the control board) to control the sign. The first thing I tried was getting the LED software to send data to USB, then get the rpi ro send that to the sign. Didn’t work. So been tweaking the script without success so far. I used a free online program called HexEd.it to create a Hex file, but that’s as far as I have got so far.

I’m working on a script with Gemini’s help but it sends data to the sign, but the sign doesn’t respond. Here is the test script so far:

https://g.co/gemini/share/8e1845fc9264

If I can get the Rpi to communicate and change the sign’s message, then I can work on the RockBLOCK (Iridium modem) ← → Rpi ,_ → LED sign, then the app.

Hi Rob,

seems you’ve got further than I thought. You have worked out a packet format and that it needs a password.

Have you looked at Wireshark on the Pi to monitor the serial port (tty) to see the responses (and possibly decode them)?

Dave

I have downloaded Wireshark but haven’t installed and tried it yet. I tried PuTTY but it can’t monitor the port that is been used by the software, so I need another set of equipment to relay the message back to another port. Portmon won’t be suitable as it asks for admin permission every time and I don’t have admin privileges at work (where I doing this). Can Wireshark monitor a port in use by another program (ie the LED software)?

But yes I think I need to hijack the serial communication directly from the software because nothing else has worked.

Hey @Rob284232,

While I haven’t use Wireshark specifically for serial ports, Wireshark’s whole deal is that it’s meant to listen into packets. If you use it on an idle Windows Computer, you will quickly see the shockingly large number of packets sent between your PC and Microsoft’s servers. So yes, it should be able to listen into a used by another program.

1 Like

I need some way of capturing the communication through my COM PORT 7 (USB) that doesn’t interfere with the program. Every tool I have used either stops the program from using the port or doesn’t monitor USB ports

1 Like

I have just looked into this a little bit more and it appears that while Wireshark works great with Linux, it doesn’t like Windows. Gotta love Windows.

The WireShark Wiki’s page on USB capturing recommends using USBPcap for Windows Serial port capture.

What OS are you working on, I have been assuming windows?
edit:
On windows you need to have some sort of driver and some of the older tools like port mon dont seem to have 64bit versions, which at the driver level will be an issue.

I am a fan of device monitor studio, but its getting a bit $$ now but does exactly what you want to do. I think the standard version is now > $US150 so at the price and if you are into electronics I would rather buy a logic analyzer.

That said…
To monitor a bidirectional setup you need to have the main coms line you want to monitor, then TWO other serial adapters to monitor with.

If you want to use some USB-RS232 Adaptors, then you will need a hook up something like this

So
PC → USB/RS232 1 → Device/Display (TX/RX)
Then USB/RS232 2 → USB/RS232 1 TX
Then USB/RS232 3 → USB/RS232 1 RX

So then monitoring USB/RS232 2 and 3 should yield the raw data between the two. At this point you need to work out the best way to collect that data.
If its binary data, then best to collect it in HEX (somehow)
if its a text based comms, then putty should be fine (as long as everything is on the same comm settings)

1 Like

I think we’re talking RS485, not sure if it is full or half duplex, but I like your thinking - a passive monitor connection (using an Opto isolated input) might do it. There are IC’s and devices that do that.
E.g. I just pulled down an application note https://www.renesas.com/en/document/apn/an1991-isolating-rs-485-interfaces-high-speed-digital-optocouplers .

Come to think of it I’m sure you could get a isolated USB to RS485 dongle.Yes, USB to RS485/422 Isolated Converter | Buy in Australia | WS-23949 | Core Electronics

Then installing software on the Company laptop is not an issue, just use Putty and log some stuff to a USB stick and analyse it at home with Wireshark on a personal laptop/PC.

Dave

1 Like

cheers I missed the 485, so that by default will be a 2 wire bus + ground, so connect A+ to A+ and B- to B- and ground to ground. As long as your USB adaptors are support the voltages (standards) then that would be a passive monitor in RX mode. then if its bidirectional where each end sends something (e.g. PC → Command … Dev ← Ack, you could see that in order via the one adaptor… Nice thing about a bus, easer to tap into .

Edit:
Sorry for the mess, I just wanted to do a quick demo for the RS485

For testing/demo, I to all 3 with putty. Top 2 are the top 2 in the above image
The Bottom is the bottom monitor. All have the same UART Settings.


We can see that no matter which one of the top 2 (e.g. PC to Screen) is talking the bottom monitor one will receive a copy as well.

2 Likes

Thanks people, I ended writing a script in python that does the job, albeit not as well or with the possibilities that the original software can do, at least at this moment. I’ll try and work on that in the future but for now I have a solution that gets the job done.

1 Like