Ability to use as a RS485 to wifi adaptor

It would be an excellent feature if an addition piece of software/driver etc could be made to access the fluksometer to use it as a RS485 to wifi adaptor.
We could then use the fluksometer RS485 input to link to our inverters to retrieve data etc.

The next step maybe an inbuilt feature allowing connection to common inverters like Aurora, SMA etc to directly import generation stats

fusionpower's picture

+1 for this idea.

If the Flukso was able to get generation figures from common inverters via RS485 it would negate the need for users to install kW/h meters to get accurate readings via pulse count. This would make the install even more user friendly and much less expensive.
(currently kW/h meter is required to eliminate false generation figures when using current clamps due to inverter overnight standby power consumption)

Is the RS485 port currently used for anything? The manual mentions that the RS485 is is mapped to sensor #6 but doesn't say what it can be used for or how to use it.

gebhardm's picture

...but who will implement all the different inverter protocols and keep them up to date? E.g. Solarlog does such, but then the simplest data logger costs around 300 Eur; I am not too confident that this can be managed in an open source project; but the requesters may prove different :-) (for example, SMA provides the protocol stack as open source, but the actual adaptation will still cost certain effort)
I am also curious about the implemented RS-485 functionality; in the source code there is a lot of code that I would expect to allow "simple terminal control" of the FLM via that interface, but didn't manage to get it running...

icarus75's picture

If you've enabled the uart on the sensor page, the RS485 interface is accessible via two fifo's (named pipes) within the /var/run/spid/uart dir. The interface is a raw byte stream, so no terminal line discipline is sitting in between the RS485 interface and the fifo's. The baud rate is hard coded to 115k for now. It can be overridden in the avr makefile (UART_DEFAULT_BAUD_RATE).

You can experiment with the RS485 interface via the shell:

  1. root@flukso-073d12:~$ echo mycommandtoinverter > /var/run/spid/uart/in
  2. root@flukso-073d12:~$ cat /var/run/spid/uart/out

Disabling the uart on the sensor page will actually enable a loopback on the AVR. So the above command sequence should then result in 'mycommandtoinverter' being returned on the out-fifo.

@Markus Why are you sceptical about a community project wrt inverter protocols? We would not need the full protocol implementation, just a subset that allows us to fetch production data. This is probably just a single query/response exchange per inverter type.

gebhardm's picture

At least the packages of the SMA protocol are quite sophisticated, with CRC, heading, alignment, content wrapping; so they provide a front-end tool to go into the inverter, not just a plain terminal capability. By the way, for what purpose are the commands in the control.c? Would it be possible to pipe them also to the UART?
Thanks and regards

Hv-man's picture

As mentioned I'd be happy to just be able to access the rs485 via an ip etc I could then use in my case aurora communicator to access to inverter.

icarus75's picture

@Markus The FLM protocol between router and sensor board is quite sophisticated, with multiplexing of uart, ctrl and delta fifo's providing synchronous as well as asynchronous communications, binary-to-hex translation, CRC for ctrl commands, etc. :-P The ctrl commands are used for sensor board configuration. Every time you save the sensor page, there's a synchronisation taking place with the sensor board, which uses these ctrl commands.

Is the SMA protocol documented somewhere?

@HV-man Then you have to code a bridge between the fifo's and an IP socket, I guess. However, I'm not so sure the software you mention supports connection over IP instead of a serial line.

gebhardm's picture

@Bart: It is a privilege of mathematicians to do it complicated if it is also possible much simpler ;-) - SMA provides technical documentation via their homepage, see Yet another SMA data protocol implementation source code; as I see there is by now a "newer" approach via the webbox using also a JSON API (but at least my inverter is not capable to understand that) - WebBox RPC - but then we are already in the net and actually don't need to convert into the FLM any more (but provide another data source capability on the server side?!) - I must admit that I am fully satisfied with my clamp to pulse converter ;-)

bazzle's picture

Off Topic - but Gebhardm can you direct me to a link for the clamp to pulse convertor please as I need to swap 2 of mine.


Hv-man's picture

Hi Bart, The aurora communicator software allows connection over IP or via serial. kind of a nice feature to simplify connection via ethernet to rs485 converters etc

gebhardm's picture

@Bazzle - look here or here. But you have to puzzle it together on your own ;-)
Best regards

Hv-man's picture

Unfortunately my skills don't extend to coding etc
Anyone keen to give this a go?

frumper's picture

ICARUS75 wrote:

> The baud rate is hard coded to 115k for now. It can be overridden in the avr makefile

i'm keen to have a play with this but my inverter talks at 9600bps. please can you give me a step by step on how i would do the above? do i need to add headers to the flukso board and buy an avr programmer? thanks.

icarus75's picture

No need to buy an AVR programmer nor for any soldering action. You can program the the AVR on the sensor board via the avrdude on the Fluksometer's main board. First power up the FLM and connect your computer to the FLM via ethernet.

Below is the command sequence in my Linux environment. rprogram is short for 'remote program' the AVR. It takes care of uploading the hex and eep files to the FLM and invokes the avrdude on the FLM with the proper settings, including fuses.

  1. icarus75@cirrus:~/dev $ git clone 'https://github.com/flukso/flm02.git'
  2. icarus75@cirrus:~/dev $ cd flm02/avr/
  3. icarus75@cirrus:~/dev/flm02/avr (develop)$ vi makefile
  4. icarus75@cirrus:~/dev/flm02/avr (develop)$ make rprogram

The last command will prompt you for the root password twice. Password is root.

frumper's picture

excellent, done. will be watching /var/run/spid/uart/out tomorrow when the sun comes up.

pkruijt's picture

Anyone got the RS485-port running to direclty connect to the Inverter? I have a Solivia 2.5 here which has a RS485 input with RJ45 connector, just using pins 6+7 of the RJ45.
There's a thread here http://forums.whirlpool.net.au/archive/1901079 where they have figured out the protocol.
Exactely that is what I'm trying to do with my new Flukso, only my Solivia talks 19200 bps.

I'm not familiar with Github and recompiling etc.

Is there an easy Telnet/ssh-way to change the baudrate of Sensor Port #6?