Might be helpful for somebody... Things configuration for OpenHab2:
Bridge mysensors:bridge-eth:gateway_2 [ ipAddress="192.168.178.50", tcpPort=5003, sendDelay=200, enableNetworkSanCheck=true ] {
/** define things connected to that bridge here */
light sonoff01 [ nodeId="0", childId="0", requestAck=true ]
}
@marceltrapman
when you change the BAUD rate setting in the source/config file to something lower/other you can also use 3.3V Arduinos as (Serial)Gateway. Of cause your controller needs also to be told about the lower BAUD rate.
Check out http://wormfood.net/avrbaudcalc.php?postbitrate=9600&postclock=8 for an overview of Clockspeeds (usually 8MHz for 3.3V and 16MHz for 5V types) and coresponding BAUD rates.
@micah said:
@sundberg84 said:
Hard to say. St:fail generally means that you don't get ack from the receiver. This is normally range, power or hardware. There is not a general fix for this but you need to try and learn... i admit its strange I worked for some days. Maybe a radio fried ?
Don't have the radios to close to eachother. Try a.couple of meters.
Sorry I'm out of more solid ideas.
Hey sundberg84, quick question for you.
If you look at my debug logs above it looks like the gateway is infact receiving the message but the node thinks it fails. Con you confirm my interpretation of the following two lines?
NODE DEBUG
send: 42-42-0-0 s=1,c=1,t=0,pt=7,l=5,sg=0,st=fail:20.0
GATEWAY DEBUG
0;255;3;0;9;read: 42-42-0 s=1,c=1,t=0,pt=7,l=5,sg=0:20.0
If that's correct, could that change what the issue might be?
Yes, I saw that - it seems to work one way but the ack (return) does not reach back. So its on the edge.
But this should update the value in your controller.
@nca78 about my gateways:
an old gateway running on MySensors 1.5 for years now. There are several nodes and sensors connected through it like temperature sensors, relays, switches. It controls my heating system with heat pump, buffering, 18 circles of floor heating, garden irrigation, alarm system, and some lights just for fun.
the new gateway is a gateway to a Bluetooth network. Since MySensors has a great serial API and I have some experience with it I preferred to use it without a radio. I also think that it will be an interesting way of development and it could help to make MySensors even more popular. I had an idea to fork the library but unfortunately I don't have the experience and time to make it in good quality. But I'm sure letting developers to build connectors to different protocols is a very good idea. Catching Bluetooth messages from the air and decode them (with some reverse engineering) to send it through the MySensors gateway is relatively simple compared to the bidirectional communications. Processing some simple sensor data is a good first step.
@scurb This looks very interesting and my factor now to save me from having to create my own :-). I have been planning to do the same thing (although maybe on a smaller software scale) by writing a simple Python server that would pull serial packets off of a gateway arduino (either running mysensors or something I write myself) and pipe this through MQTT to openHAB. I have two questions:
How do you interface with a sensor network? Do you go through a serial connection to read the serial packet format (a,b,c,d)? I see several implementations that put the mqtt client directly on the Arduino, but it seems much cheaper for me to just plug it into a USB port to get a virtual serial port instead of investing in a separate ethernet shield
How does an item configurations look like for a switch in openHAB? I'm looking to build a toggle switch which toggles light on or off every time it is activated, and I cannot really understand how to configure the switch to allow this behaviour for an mqtt input.
Feel free to take the second question with me directly since this might not be very interesting to the others in the forum