Arduino as a RS485 "recorder" possible?

Hi guys

I have a Wood Pellet Boilers installed in our house that has a RS485 communication port. I know it's possible to buy an accessory module that allow me to control the burner through SMS (start/stop/status etc).

The chip on the boiler is a SP483C. Found the data sheet for those who are interested SP483CS (Sipex) - Low Power Half-Duplex RS-485 Transceivers

But to get to the point - I'd like to hook into that communication port and control the boiler from my Arduino. I'm quite new to RS485, but I understand I can get a TTL to RS485 converter, so my Arduino can communicate using RS485.

But what are my options - is it even possible to "tab" into that line knowing nothing about the protocol and commands that are used?

I have the firmware the boiler runs on, but it's compiled into a .uc3 file and not readable (to me at least). It's compiled to run on an Atmel 32uc3a0512 http://www.atmel.com/devices/AT32UC3A0512.aspx

Any pointers or guidance would be appreciated - even if the answer is - don't do it, not possible :slight_smile:

Have a nice day!

RS485 is a half duplex protocol. That means only one device is transmitting at any time. It is normally implemented in a Master / Slave arrangement where the Master initiates communications and asks the slaves in turn if it has any data to give it or that it has data for it. This is called polling.
There are several protocols but most work in this way with "packets" of data or messages being sent.

This means it is easy to spy on the messages as they move backward and forward. However, to actually break in is a bit more tricky as the Master has to know you are there and you can only talk to the Master.

An interesting exercise but no guarantees that it is possible to make it work unless you replace the Master altogether.

Hi Mike

Thanks for the fast reply.

Who's the Master or Slave would depend on "who's asking", right? I mean, if the SMS module that I would like to "emulate" is asking for a status, wouldn't it make that the Master in that case? and the same with a start/stop command. Only when the module should get a response back, the roles are turned around? Depends on who is transmitter or receiver?

But as I don't have the original SMS module that I would like to emulate, how can I know what protocol to use - it could be something they made? And even if I found the protocol, how can I find the commands to transmit?

Who's the Master or Slave would depend on "who's asking", right?

No that will be built into the system from the start.

Only when the module should get a response back, the roles are turned around?

No, the master initiates data transfer what ever this is. If it is the Master sending commands, or if it is asking for a status report. So that means that the slave hast to wait until asked before sending anything. The device sending the data back is still the salve.

But as I don't have the original SMS module that I would like to emulate, how can I know what protocol to use

Tricky.

And even if I found the protocol, how can I find the commands to transmit?

Yes the protocol and the API ( messages to send ) are tricky to find.

Ahh... I understand the Master/Slave now :slight_smile: Thanks. So in reality I would have to get my hands on a SMS module, so I could "spy" on the transmission between the Master and Slave, right?

Yes that is right.

AngeloGomes:
I was interested in some way to do something similar to this with a turbo pump station TSU071E from Pfeiffer.

The pump controller is connected t oa DCU01 unit which has the lcd display and buttons to change parameters, and the communication is through RS485 using pfeiffer protocol (info easy available).

Well, I´would like to control the pump from computer/arduino. Following the instruction manual, I have to disconnect the DCU and install a direct connection to the computer/arduino or have to use the DCU unit.

Now I have an idea:

Let´s say DCU has address 01, Pump Controller has address 10.

I would change the pump controller to address 11 and set arduino to address 10.

So with this configuration, arduino would intercept any request from DCU, and send it to address 11, then it gets the response and send it back to address 01. If I need to send a command, as to start/stop the pump from the computer, I would send the command directly to address 11, just injecting a command into stream from the DCU.

Would this work ?

I see no reason to hijack another thread with your question. Start your own thread.

To answer your question here, only if the protocol was designed to use multiple slave units. Otherwise there would be no reason use addresses in the protocol.

Paul

dyvel:
Hi guys

I have a Wood Pellet Boilers installed in our house that has a RS485 communication port. I know it's possible to buy an accessory module that allow me to control the burner through SMS (start/stop/status etc).

The chip on the boiler is a SP483C. Found the data sheet for those who are interested SP483CS (Sipex) - Low Power Half-Duplex RS-485 Transceivers

But to get to the point - I'd like to hook into that communication port and control the boiler from my Arduino. I'm quite new to RS485, but I understand I can get a TTL to RS485 converter, so my Arduino can communicate using RS485.

But what are my options - is it even possible to "tab" into that line knowing nothing about the protocol and commands that are used?

I have the firmware the boiler runs on, but it's compiled into a .uc3 file and not readable (to me at least). It's compiled to run on an Atmel 32uc3a0512 http://www.atmel.com/devices/AT32UC3A0512.aspx

Any pointers or guidance would be appreciated - even if the answer is - don't do it, not possible :slight_smile:

Have a nice day!

This is an old post, but having done a significant amount of device control programming, it is interesting to me.

First, yes... converting Arduino serial I/O to RS485 will be fairly easy, and you can both buy or build such adapters without too much fuss.

But on to the bigger issue of actually controlling and or monitoring the device. Before trying to reverse engineer the code (often difficult even if you had the current version of source code), it is usually best to start by making every effort to get some documentation on the communication protocol right from the manufacturer. Sometimes it takes approaching them as if you were a company looking to make an add on (maybe much like what you are planning) which could then add value of their device and potentially bolster sales. That strategy works especially well if you have some backing, such interest on behalf of several of their customers for the device you're planning.

In the absence of getting the protocol handed to you, yes... it is still possible to connect an RS485 device as a "listener"/recorder, if you have one of the devices the unit is supposed to connect with. This is often the only way to find out what is needed to communicate with a device when a manufacture is unwilling to be cooperative. but this is still not an easy task. As one other person pointed out though, RS485 is half duplex, requiring the protocol to have an agreed understanding as to which side initiates conversation. In your case it is likely that the available module would be the side initiating requests, but it can become difficult at times to know which messages are coming from which device, except in the rarer case or 4 wire RS485. On a two wire path, often if you can monitor the signals with an oscilloscope, there will be a good chance you'd see a slight different in the amplitude peak levels of bit streams from each device, because each may have a slightly different 5 volt supply. That may help to identify who is speaking at any given instant. Hopefully there will be a small number of messages for a given function, and with the recorder you might be able to capture what is going on.

But there are other challenges here too. First, you need to know particulars of the serial communication (baud rate, parity, and number data and of stop bits, and that's just if its ASYNC communication!). Since you don't, you may be recording garbage for a while before finding anything that makes sense. And to make it even worse, if the protocol is pure binary (such as a MODBUS, DNP, or completely "in house" protocol), it will be difficult to tell whether recorded data streams get you a buffer full of garbage, or real data. It is possible using an oscilloscope to observe and analyze the data and at least figure out the baud rate, by observing minimum "bit" times and doing the necessary math. It is important to get the serial details right because if you don't, "playing back" your captured messages through the UART will just turn the garbage into worse garbage.

As you can see, you could get lucky, but it could also become a nearly impossible task. If its a simpler text based protocol is being used you may have a shorter time to analyze before things make obvious sense. sadly, text based protocols are unlikely for something like this. And beyond just the data part of the protocol, there are other less likely but possible problems. If the devices use proprietary serial electronics, for example to generate a non standard number of data bits or some other protocol not based on serial standard serial communications, you're ARDUINO will not easily record what is being transmitted, except possibly as an A/D input with some tricky analysis. On top of that, if the manufacturer has any security scheme in place whose purpose it to prevent "unauthorized" control, your time to crack the protocol could rapidly get to the "not worth it" point.

But despite all that negativity, I can tell you its do-able. I've worked with a team of folks whose job it was to crack such communication schemes, mostly for the purpose of monitoring electrical measurements available from the device we wanted to connect to. It wasn't always easy, but there were usually at least a few happy surprises along the way. Good luck! :slight_smile:

I did not hijack nothing

You bloody well did.

Maybe for some people is better not to get topics with the same subject spread all over the forum, maybe some people wants other way

Yes but they are not this community. If you could be bothered to read the rules How to use this forum you would find that we do not want you to hijack a thread, but start your own.

I am really sorry guys.

I will open a thread.