Community
OpenEnergyMonitor

Community

Using emonpi as an RF repeater (via emonhub)?


(Alexandre CUER) #1

Hello

When, on emonhub.conf, in the Jee interfacer section, I uncomment the line :

interval = 60 # Interval to transmit time to emonGLCD (seconds)

the RF adapter on the Pi or the base begins to send RF packets (4 bytes long)
I guess these packets are for the emonGLCD but others Pi(s) or Base(s) receive them as well…

What I have in the log of the ‘sending’ emonhub are the following lines

2018-05-31 15:37:46,470 DEBUG RFM2Pi RFM2Pi broadcasting time: 15:37
2018-05-31 15:37:47,175 DEBUG RFM2Pi device settings updated: E i5 g210 @ 433 MHz q0 USA 0
2018-05-31 15:37:47,383 DEBUG RFM2Pi confirmed sent packet size: -> 4 b

is it possible somewhere in the code to control the structure of the payload sent by the RFM12PI interfacer ?

Alex


(Paul) #2

I assume you are using the emonPi variant of emonhub?

The RFM2Pi uses JeeLib and the payload to send data is shown in the RFM2Pi help menu as

 t          - broadcast max-size test packet, request ack
 ...,<nn> a - send data packet to node <nn>, request ack
 ...,<nn> s - send data packet to node <nn>, no ack

There was working code in emonhub so that data could be transmitted via the RFM2Pi but I have no idea if it is still operable as it doesn’t get used.

You should be able to set up a socket interfacer with the setting pubchannels = ToRFM12, and be able to send a payload via that socket and the rfm2pi using (for example) a simple bash command like

printf "1 2 3 4\r\n" > /dev/tcp/emonpi/50011

this would send 3 bytes values (1, 2 & 3) for the attention of node 4, alternatively

printf "240 250 255 0\r\n" > /dev/tcp/emonpi/50011

would send 3 bytes values (240, 250 & 255) for the attention of node 0 (AKA any and all nodes within range and in the same group).

From what I understand you can send up to 60bytes (or there abouts) each value can be 0-255, how those values are encoded/decoded is up to your source and receiver, just be wary that other devices maybe listening, although most if not all OEM devices except the emonGLCD have no receiver code.

You can of course also edit emonhub to do what you like directly, this is the relevant bit of code, the sending of the time for emonGLCD is separate to the ad-hoc sending function in this variant, the original version used the send function to send the time rather than writing to the serial port directly.


Output control via RF?