Can I suggest adding an "IDE" subcategory under the Development category ?
I'm investigationg PlatformIO as an alternative for the Arduino IDE and Visual Micro for writing MySensors programs and was surprised not to find much info on the forum.
Maybe having and IDE subcategory could spark some discussion about this - interesting - subject
stefaanv
Posts
-
PlatformIO subcategory -
💬 Sensebender MicroIs there a board definition for sensebender micro for PlatformIO available ?
-
MySensors binding seems to prevent other bindings from working properlyHi, I've come across a problem where the MySensors binding seems to make some claim on the serial port of other bindings (RFXcom in my case), preventing the other binding to work properly.
The case is documented here on github.
Is this a bug in the MySensors binding or somehow linked to my setup and configuration ?
Any ideas on how to further investigate / solve this problem ? -
Sensebender Micro Mechanical designHi,
I love the sensebender micro, having about five of them around the house measuring all kinds of things. Being able to buy the assembled PCB from the internet is great !
The compactness of the design is nice for building really small sensors, but in my humble opinion has one mayor drawback. There is no easy way to mechanically fix the PCB into a housing. Not suprisingly, I haven't seen a compelling case designs for the sensebender micro yet. Most designs have the board and the batteries floating inside.
I always end up fixing the naked PCB with two-sided tape to a wall or a to a piece of furniture, usually fixing the batteries right next to the sensor PCB in the same manner. The net effect being that my wife is becoming increasingly unsupportive of my MySensors hobby !
May I suggest that for future designs the wife factor is taken into account ? Two diagonal holes to fit screws and some free PCB space underneath for supports would be very helpfull.
Stefaan
-
💬 Sensebender Gateway@tbowmo OK, is working now after restarting the bundle in OH.
Must have been the permission problem after all.
Thanks for your help !! -
💬 Sensebender Gateway@tbowmo Definately ttyACM0
However, the setserial command returns information that doesn't look good : port0 and IRQ0. Does the board need a driver under Linux ?stefaan@home:~$ sudo setserial /dev/ttyACM0 /dev/ttyACM0, UART: unknown, Port: 0x0000, IRQ: 0, Flags: low_latency``` -
💬 Sensebender GatewayttyUSB0 is a (different) RFXcom device
-
💬 Sensebender GatewayHere is my configuration file (mysensors.things)
Bridge mysensors:bridge-ser:gateway [ serialPort="/dev/ttyACM0", sendDelay=200 ]
{
humidity keuken_vochtigheid [ nodeId="3", childId="2", smartSleep=true ]
temperature keuken_temperatuur [ nodeId="3", childId="1", smartSleep=true ]
}I suppose ttyACM0 because of
stefaan@home:~$ dmesg |grep -i tty
[ 0.000000] console [tty0] enabled
[ 22.328631] 8086228A:00: ttyS4 at MMIO 0x81420000 (irq = 39, base_baud = 2764800) is a 16550A
[ 22.329059] 8086228A:01: ttyS5 at MMIO 0x8141e000 (irq = 40, base_baud = 2764800) is a 16550A
[ 23.106128] usb 1-4: FTDI USB Serial Device converter now attached to ttyUSB0
[362074.592743] cdc_acm 1-3:1.0: ttyACM0: USB ACM deviceThere seems to be a premissions problem om the port :
stefaan@home:~$ cat /dev/ttyACM0
cat: /dev/ttyACM0: Permission denieddoing 'sudo usermod -a -G dialout openhab' doesn't help
Anyone any ideas ?
-
💬 Sensebender GatewayHi, I'm trying to activate a sensebender gateway in OH2 on Ubuntu 16.04, however I'm having trouble setting up the serial port. Is there a how-to somewhere ? I suspect the serial port name is /dev/ttyACM0, but I'm not sure. How can I test ?
MySensors bundle is reported to be active, but there's no messages coming in. I set the log level for mysensors to DEBUG, but nothing on the log. -
💬 Sensebender GatewayWhich driver to use on Ubuntu 16.04 ?
-
Are folks here happy with Domoticz?I've used domoticz for a few years but got more-and-more stuck on it's limitations. I'm not a great fan of lua either. I'm more a c# and javascript person.
I have invested my time in OpenHAB2 lately and I'm very happy with it. Much more solid in terms of software design imho. Very large hardware support. Seems to be a larger community as well.
Setup is not as easy as with Domoticz, takes more reading and getting used to, but in the end I'm happy that I switched to OpenHAB.
HabPanel is a nice extension to OpenHAB for building UI's. -
Setting parameters in nodes@FredRoot
Your mqtt-eventbus.cfg configuration should look like thisbroker=mosquitto statePublishTopic=openHAB/out/${item}/state stateSubscribeTopic=openHAB/in/${item}/state commandSubscribeTopic=openHAB/in/${item}/command -
Setting parameters in nodes@FredRoot
To answer your questions1. "mosquitto.clientId=openhab"
I got my inspiration for setting up the eventbus-to-mqtt bridge from this website
Basically, in the mqtt.cfg file you're defining which mqtt broker openhab must talk to. Afaik you can freely chose the broker name, but I wasn't very adventurous and simply copied the example configuration.You DO have to install an MQTT broker separate from openhab. Mosquitto is the most common one.
The clientID setting can be about anything, it is like a call name for the broker to identify its counter parts. the clientID is often auto-generated by using random numbers. You can use anything as long as this same ID is not used by anyone else on the same broker (which is a problem in what you're doing further down).2.
In
broker=mosquittothe second part must be the same like the part before the dot inmosquitto.clientId=openhab. It is an identification for the MQTT broker that you're using in the different openhab configuration files.topic=openHAB/out/test_text/command ...iscommandSubscribeTopic=openHAB/in/${item}/commandwhere ${item} was replaced with the name of the item which in this case istest_text. Openhab will do the insertion of the item names for you.3. & 4.
That look OK.
Best thing to do is to install a program like MQTT-Spy. It allows you to see all the messages being processed by the MQTT broker and send messages in a convenient way. Trying to do this from the Linux CLI is overly courageous.
Anyway, you should definately not use the-i openhabswitch with mosquitto_sub or _pub. You need to use a different clientId than the one openhab is using. You're not trying to trick mosquitto in believing you're openhab. Instead you're trying to talk to openhab through the MQTT boker.An interesting one is to enable debug logging for the MySensors binding on the Karaf interface. That way you can see what openhab is sending to your MySensors gateway.
Here's how you do that
- Open an ssh connection to your openhab server
- Type
ssh -p 8101 openhab@localhost. The password will probably behabopen. This is the Karaf CLI
Some usefull Karaf commands
log:tailwill show the Openhab logs as they come in. You can pipe this command with grep if you're looking for something specific.- Use
log:set xxxxxto adapt the logging level smarthome:things listto see all your thingssmarthome:things listto see all your things
So to see what openhab is sending to the MySensors gateway use these commands
log.set DEBUG org.openhab.binding.mysensors log.tailNow if you send an MQTT configuration message to openhab using MQTT_Spy, you should see the message being passed to the mysensor gateway. This will help you debug the setup.
Stefaan
-
Smartsleep with 20ms polling Timer1 ISRI'm developming a node that polls a sensor every 20ms through a Timer1 interrupt. The main loop of the program has a 1000ms wait/sleep cycle that decides whether or not to send MySensors messages depending on the sensor value.
In orde to preserve energy, I'd like to use smart sleep.My question is, will smartSleep work in together with the faster interrupt cycle ? I assume the interrupt will wake the node from smart sleep, but what happens at the end of the interrupt service routine ?
Does smartSleep resume automatically ?
Or should I call smartSleep at the end of the ISR ? Does that make sense ? Will smartSleep work properly when it is called every 20 ms ? -
💬 NodeManagerThe configuration service is a good ideaal.
Even better would be if it would allow setting and reading user parameters. -
Setting parameters in nodesI got this one solved for openHab2, but I guess the same trick can also work with other controllers.
In openhab, activate the mqtt-eventbus bridge that copies all events on the eventbus to an mqtt broker of your choice.The
mqtt.cfgconfiguration file (example)mosquitto.url=tcp://localhost:1883 mosquitto.clientId=openhab mosquitto.retain=true mosquitto.async=falseThe
mqtt-eventbus.cfgconfiguration file (example)broker=mosquitto statePublishTopic=openHAB/out/${item}/state stateSubscribeTopic=openHAB/in/${item}/state commandSubscribeTopic=openHAB/in/${item}/commandIn the openhab .things configuration file, add a text element elements for the node
... text test_text [ nodeId="4", childId="200"] customSensor gasMeter [ nodeId="4", childId="1"] ...In the .items configuration file, add the text element as well
String test_text "text" <text> {channel="mysensors:text:gateway:test_text:text"} Number gasMeter_teller "Counter" <var1> {channel="mysensors:customSensor:gateway:gasMeter:var1"} Number gasMeter_pulsLengte "Pulse Lengte" <var2> {channel="mysensors:customSensor:gateway:gasMeter:var2"}On the node, define an extra S_INFO/V_TEXT child sensor. The below code example parses incoming instructions (in the receive() function).
#define CHILD_ID_TEXT 200 MyMessage textMsg(CHILD_ID_TEXT, V_TEXT); void presentation() { ... present(CHILD_ID_TEXT, S_INFO); ... } ... void receive(const MyMessage &message) { if (message.type == V_VAR1) { pulseCounter = message.getLong(); // Update the main counter value at node startup or when updating the value in openhab UI } if (message.type == V_TEXT) { //this code could be more professional, just doing it quick and dirty for now String all = message.data; int equalSignPosition = all.indexOf('='); if (equalSignPosition < 0) return; String key = all.substring(0, equalSignPosition); String value = all.substring(equalSignPosition +1, all.length()); if (key == "debouncePeriod") { int dbPvalue = value.toInt(); if (dbPvalue > 5 && dbPvalue < 5000) { debouncePeriod = dbPvalue; SendParameter("Debounce period",debouncePeriod); } } if (key == "timeBeforeSleep") { long tBFSvalue = value.toInt(); if (tBFSvalue > 1000 && tBFSvalue < 300000) { timeBeforeSleep = tBFSvalue; SendParameter("Time before sleep", timeBeforeSleep); } } if (key == "info") { Serial.print("Sending information"); SendParameter("debouncePeriod", debouncePeriod); SendParameter("timeBeforeSleep", timeBeforeSleep); SendParameter("pulseCounter", pulseCounter); } } } void SendParameter(char* parameterName, unsigned long variable) { char buffer[30]; sprintf(buffer, "%s->%lu", parameterName, variable); Serial.println(buffer); send(textMsg.set(buffer)); } ...Now parameters can be changed by sending mqtt messages to openhab which will forward the instructions to the node. Feedback is provided in the reverse way for every parameter change.
For example, to change the debounce period, send an MQTT message with topic=openHAB/in/test_text/commandand data=debouncePeriod=<value>. The feedback is provided on topic=openHAB/out/test_text/commandwith data=debouncePeriod-><value>.
To get an overview of the parameters, sendinfo=. One message is returned for every parameter and one for the current meter counter value. -
Ethernet API/protocol informationHi,
I'm looking for information about the protocol/API to use to connect and talk to an Ehernet gateway. Although there is plenty of information around about the serial protocol, Ethernet protocol seems to be shrouded in mystery.
How to connect to the gateway (UDP, TCP, ...), how to keep the connection alive, is the serial API somehow embedded into a network stream ....
Stefaan
-
Internet of Poultry - Fully automated chicken shed@Nathan-Overley
Hi Nathan, it's not nice code, been written too quickly. I have to rewrite it some day. Still, here it is, it may give you idea's. Let me know if you improve it.
0_1477377889434_Kippenhok_3.ino -
[solved] Problem with ioBroker and MySensors 2.0@hek
Hadn't done any of the decoupling. Will do so next.
However, by moving the controller closer to the shed, The problem is solved !!
Thanks a million for the support ! -
[solved] Problem with ioBroker and MySensors 2.0@hek
We're making progress. I'm already seeing both nodes in ioBroker Objects tree. The sensebender node also reports temperature and humidity.
Still, none of the measurements from the chicken shed node get through. Underneath is the log from this node, hope you can make any sense of it. I see a lot of FPAR:FAIL's, hope this is something that can be solved.Stefaan
Starting sensor (RNNNA-, 2.0.0) TSM:INIT TSM:RADIO:OK TSP:ASSIGNID:OK (ID=1) TSM:FPAR TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: !TSM:FPAR:FAIL !TSM:FAILURE TSM:PDT TSM:INIT TSM:RADIO:OK TSP:ASSIGNID:OK (ID=1) TSM:FPAR TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: !TSM:FPAR:FAIL !TSM:FAILURE TSM:PDT TSM:INIT TSM:RADIO:OK TSP:ASSIGNID:OK (ID=1) TSM:FPAR TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: !TSM:FPAR:FAIL !TSM:FAILURE TSM:PDT TSM:INIT TSM:RADIO:OK TSP:ASSIGNID:OK (ID=1) TSM:FPAR TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSM:FPAR TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSP:MSG:READ 0-0-1 s=255,c=3,t=8,pt=1,l=1,sg=0:0 TSP:MSG:FPAR RES (ID=0, dist=0) TSP:MSG:PAR OK (ID=0, dist=1) TSM:FPAR:OK TSM:ID TSM:CHKID:OK (ID=1) TSM:UPL TSP:PING:SEND (dest=0) TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=ok:1 TSP:MSG:READ 0-0-1 s=255,c=3,t=25,pt=1,l=1,sg=0:1 TSP:MSG:PONG RECV (hops=1) TSP:CHKUPL:OK TSM:UPL:OK TSM:READY Kippenhok_4 Motor stopped at 60735 application started TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=1,pt=0,l=0,sg=0,ft=0,st=ok: TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=ok:0100 !TSP:MSG:SEND 1-1-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=fail:2.0.0 !TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,ft=1,st=fail:0 TSP:MSG:READ 0-0-1 s=255,c=3,t=0,pt=0,l=10,sg=0:1476000019 TSP:MSG:ACK msg TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=0,pt=0,l=10,sg=0,ft=2,st=ok:1476000019 !TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=11,pt=0,l=9,sg=0,ft=0,st=fail:Kippenhok !TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,ft=1,st=fail:1.0 !TSP:MSG:SEND 1-1-0-0 s=1,c=0,t=16,pt=0,l=0,sg=0,ft=2,st=fail: !TSP:MSG:SEND 1-1-0-0 s=2,c=0,t=30,pt=0,l=0,sg=0,ft=3,st=fail: !TSP:MSG:SEND 1-1-0-0 s=3,c=0,t=6,pt=0,l=0,sg=0,ft=4,st=fail: !TSP:MSG:SEND 1-1-0-0 s=4,c=0,t=7,pt=0,l=0,sg=0,ft=5,st=fail: !TSM:UPL FAIL, SNP TSM:FPAR TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: !TSP:SEND:TNR !TSP:SEND:TNR !TSP:SEND:TNR !TSP:SEND:TNR Request registration... !TSP:SEND:TNR TSM:FPAR TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: !TSP:SEND:TNR TSM:FPAR TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: !TSP:SEND:TNR TSM:FPAR TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: !TSP:SEND:TNR !TSM:FPAR:FAIL !TSM:FAILURE TSM:PDT Init complete, id=1, parent=255, distance=255, registration=1 ... loop ... !TSP:SEND:TNR Door Open, Lux 1407.40, luxState 1, camera off, (-) Battery 12.07V, -11.90mA !TSP:SEND:TNR !TSP:SEND:TNR !TSP:SEND:TNR !TSP:SEND:TNR !TSP:SEND:TNR !TSP:SEND:TNR !TSP:SEND:TNR !TSP:SEND:TNR !TSP:SEND:TNR --NO-- Time = 5, 0:0:5 ... loop ... !TSP:SEND:TNR Door Open, Lux 1384.85, luxState 1, camera off, (-) Battery 12.07V, -11.20mA !TSP:SEND:TNR !TSP:SEND:TNR !TSP:SEND:TNR !TSP:SEND:TNR !TSP:SEND:TNR !TSP:SEND:TNR !TSP:SEND:TNR !TSP:SEND:TNR !TSP:SEND:TNR --NO-- Time = 10, 0:0:10