I would like to control an 8-relay board attached to GPIO port of a brand new raspberry pi via tcp.
I looked at the GPIO binding but I think it only works when openhab is running on the pi. My openhab setup runs ona dedicated pc on the same network as the pi.
I found some information about webiopi but don't know how or if it is possible to use that witb openhab. I do not have a piface board either, all i need is to control the gpio pins directly.
The opensprinkler pi implementation looks like a good start but i do not plan to use a shift register on the outputs so this can not be used directly.
I would like to find out:
1. Which image should I start with I write to my sd card?
2. Which script should I install on the pi?
3. Which binding to use on the openhab side? (Gpio, tcp, opensprinker?)
I have very good knowledge of programming microcontrollers and application development in C and C++. I am also learning Python at the same time. Hope this may help :-)
Thank you
Eric
I installed Mosquitto MQTT Broker on my windows machines that runs openHAB. On the windows machine, I am able to start mosquitto-pub and mosquitto-req to publish and received topics. I setup MQTT in openhab.cfg to broadcast the event bus on MQTT. I see the event in mosquitto-req running on the same PC as openhab or even on another PC where I installed mosquitto and running mosquitto-req. Events on openhab bus are now broadcasted to another PC via TCP.
On on raspberry pi, I used mqtt-gpio-monitor.py program as discussed here:
https://github.com/sumnerboy12/mqtt-gpio-monitor
My windows machine running openhab and mosquitto is on 192.168.2.39
The mqtt-gpio-monitor program cannot connect to 192.168.2.39. The log file shows : ERROR Error connecting to 192.168.2.39:1833: [Errno 111] Connection refused
I made sure the pi sees the windows machine, ping 192.168.2.39 works. I am also able to connect to mosquitto from another pc so the problem seems to be with the pi.
Below is the content of my mqtt-gpio-monitor.ini file:
[global]
MODULE = <gpio>
DEBUG = True
MQTT_HOST = 192.168.2.39
MQTT_PORT = 1833
MQTT_USERNAME =
MQTT_PASSWORD =
MQTT_CLIENT_ID = mqtt-gpio-monitor
MQTT_QOS = 2
MQTT_RETAIN = False
MQTT_CLEAN_SESSION = True
MQTT_TOPIC = /openHAB
MQTT_LWT = /clients/mqtt-gpio-monitor
MONITOR_PINS = 1, 2, 3, 4
MONITOR_POLL = 0.1
MONITOR_REFRESH = /mqtt-gpio-monitor/refresh
Any idea what could be wrong?
Eric
Running:
mosquitto_sub -h 192.168.2.39 -t /# -v
I am able to see openhab event bus ON and OFF commands on items.
I did not change any settings in mosquitto.conf. In fact I can not make any changes to it as windows is telling me the file is in use, even after I stop the mosquitto broken from the SERVICES in Control Panel...
Sorry, Noob here ;-)
How do I install the mosquitto client on the pi?
Sorry, Noob here ;-)
Yep - but can you try on the RPi?
--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/Y65IYe7WMI4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/d/optout.
Without knowing too much about your setup I would suggest checking the mosquitto configuration to ensure it is permitting connections from machines other than localhost. Can you install the mosquitto client on the Raspberry Pi and check if you can connect to your broker using that?
--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/Y65IYe7WMI4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/d/optout.
Ben,No worries and thanks again.Now for my next raspbian-newbie problem. Getting your scipt ro run at reboot of the pi.Seriously, I've been googling and trialing it now for another hour and nothing seems to work.... grrrrI tried :rc.local/etc/initcrontabto no avail so far.Cheers,DirkB
Op dinsdag 9 december 2014 21:37:04 UTC+1 schreef Ben Jones:
--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/Y65IYe7WMI4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/d/optout.
Hi Dirk,I do understand your frustration, I have been thru it all myself ;). But in my experience if someone spoon feeds everything you don't end up understanding it and then when you have problems later on you are back to square one.The issue is something like mqtt-gpio-monitor was written as a tool (by me) to solve a specific task. I released it to group in the hope someone else would find it useful, but it is by no means a 'supported' tool. It is not part of openHAB but just something I knocked together to help with integrating MQTT enabled RPis.If you want to contribute a 'mqtt-gpio-monitor for dummies' document then I am sure future users would be very appreciative!Cheers,Ben
--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/Y65IYe7WMI4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/d/optout.
Hi Ben,Your support is much appreciated, thank you.I did a little thinking indeed and deducted that the actual physical pin nr's are required and not the GPIO pin nrs.For newbies (like myself) who never done python, I must say that getting this stuff going is really quite frustrating mostly because of lack or (incomplete) documentation.All my posts would have been unnecessary if there had been some kind of "mqtt-gpio-monitor for dummy's"-explanation.But no worries, I'm getting there ... step by step.Thanks again !Grtz,
DirkB
Op dinsdag 9 december 2014 20:34:16 UTC+1 schreef Ben Jones:
--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/Y65IYe7WMI4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/Y65IYe7WMI4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/d/optout.
MODULE = gpio
On Wednesday, 10 December 2014 01:54:28 UTC+13, Dirk Boon wrote: