|
Post by chrisinkc on Jan 28, 2016 19:37:47 GMT
Newbie here. Thanks to everyone for sharing all of this wonderful info! I have been following the 2.3 Gateway version as described by Papa. I have everything set up. The ethernet is working (I can see it on the network). The MQTT server is working (LED is solid on). The radio is NOT working. I get "No Connection" errors on the ethernet gateway and at the node end when I check the IDE serial monitors. I have a feeling it has to do with the RFM69HW chip not being setup properly in the sketches. See the pic of my RF chip below. I followed this link to purchase my RF chips: www.ebay.com/itm/RFM69HW-433Mhz-20dBm-HopeRF-Wireless-Transceiver-RFM69HW-433S2-/171329729831 This is the link that was provided for the part in the original instructable; www.instructables.com/id/Uber-Home-Automation-w-Arduino-Pi/I have compared my RF chip with all of the pics that other members have posted and mine looks identical EXCEPT, the Black mark is in the box next to 433MHz instead of 915MHz. I assumed this meant that I had somehow ordered the wrong part and that I must use the 433MHz band instead of 915MHz. So in my sketches, I used the following code: //Match frequency to the hardware version of the radio (uncomment one): #define FREQUENCY RF69_433MHZ //#define FREQUENCY RF69_868MHZ //#define FREQUENCY RF69_915MHZ My questions are: 1) Do I have the correct chip? 2) Do I need to set it up as a 915MHz chip or do I have to use 433MHz? 3) Am I missing something else? Thanks.
|
|
|
Post by computourist on Jan 28, 2016 19:47:11 GMT
433 Mhz should work OK. Just change the frequency setting to 433 Mhz and you should be fine. No other adjustments needed...
|
|
|
Post by chrisinkc on Jan 28, 2016 23:34:06 GMT
I just tried switching both to 915MHz and this is what I got from the serial monitors: Node Software Version DHT V2.2
Transmitting at 915 Mhz... No connection... No connection... No connection... message 49 sent... message 40 sent... message 16 sent... message 48 sent... message 49 sent... No connection... No connection... No connection...
For the gateway: Gateway Software Version GW V2.3
Listening at 915 Mhz... connecting... connection failed... got connection with MQTT server 2, 16, 0, 1, 0.00, RSSI= -78 Node: 2 Version: DHT V2.2 MQTT message: home/rfm_gw/nb/node02/dev16: ON 2, 48, 0, 1, nan, RSSI= -79 Node: 2 Version: DHT V2.2 MQTT message: home/rfm_gw/nb/node02/dev48: NAN 2, 49, 0, 1, nan, RSSI= -79 Node: 2 Version: DHT V2.2 MQTT message: home/rfm_gw/nb/node02/dev49: NAN
Any thoughts?
|
|
|
Post by chrisinkc on Jan 29, 2016 1:10:48 GMT
Is this what is is supposed to do? I don't have any sensors hooked up yet as I wanted to make sure this would first.
|
|
|
Post by camblonie on Jan 31, 2016 15:09:27 GMT
Chris, It looks correct. The bottom 2 in the gateway show it received messages for temp and humidity but the sensor wasn't hooked up so there is no value yet. Keep going!
|
|
|
Post by chrisinkc on Feb 1, 2016 22:52:27 GMT
Good news is the radios are working. I stuck with the code for the 915Mhz. What really helped was making the change to the w5100.h file mentioned in other threads. Bad news is the output to Openhab is not what it should be. I'm trying to figure out if the issue is with mqtt or with my openhab files. I used the files that Papa referenced in his posts for the sitemap, items, rules, and persistence files. I'm wondering if I need to make some adjustments since Papa was running OpenHab and MQTT on a Windows machine and I am running both on my Raspberry Pi. Here is a sample of the mqtt messages I am getting from the gateway: I assume this is what it should look like. I only have a dht11 sensor hooked up. Here is what my Openhab web interface looks like: The values never change so I must have a disconnect between the mqtt server and openhab?? Any thoughts on where to look?
|
|
|
Post by camblonie on Feb 1, 2016 23:37:57 GMT
Post your items file. Probably something small.
|
|
|
Post by chrisinkc on Feb 2, 2016 1:05:33 GMT
Here is my item file:
// home.items OpenHAB config file (coordinates with home.rules, home.sitemap, & other config files)
// A BASIC version for OpenHAB to work with a Gateway & one DHT End Node (Node02) with push button, relay, & DHT11 sensor
Group Nodes (Network)
String getNode2Rssi "get Node2 rssi" {mqtt=">[mosquitto:home/rfm_gw/sb/node02/dev02:command:*:default]"}
Number Node2Rssi "Node2 RSSI [%.3f db]" <network> (Nodes) {mqtt="<[mosquitto:home/rfm_gw/nb/node02/dev02:state:default]"}
String getNode2Voltage "get Node2 Vdd" {mqtt=">[mosquitto:home/rfm_gw/sb/node02/dev04:command:*:default]"}
Number Node2Voltage "Node2Voltage [%.3fVdd]" <battery> (Nodes) {mqtt="<[mosquitto:home/rfm_gw/nb/node02/dev04:state:default]"}
Switch Act_Node02 {mqtt=">[mosquitto:home/rfm_gw/sb/node02/dev16:command:ON:ON],>[mosquitto:home/rfm_gw/sb/node02/dev16:command:OFF:OFF]"}
String Node02_SSR_Toggle {mqtt=">[mosquitto:home/rfm_gw/sb/node02/dev16:command:*:default]"}
/* Indoor Conditions */
/* itemtype itemname ["labeltext"] [<iconname>] [(group1, group2, ...)] [{bindingconfig}] */
/* [%.1f °F] below for Fahrenheit. Use [%.1f °C] for Celsius */
Number Temperature_Node02 "Temperature_Node02 [%.1f °F]" <temperature> {mqtt="<[mosquitto:home/rfm_gw/nb/node02/dev48:state:default]"}
Number Humidity_Node02 "Humidity_Node02 [%d %%]" <humidity> {mqtt="<[mosquitto:home/rfm_gw/nb/node02/dev49:state:default]"}
Group Weather_Chart (Weather)
Number Weather_Temperature "Outside Temperature [%.1f °F]" <temperature> (Weather_Chart) {weather="locationId=home, type=temperature, property=current, unit=fahrenheit, scale=1"}
Number Weather_Humidity "Outside Humidity [%d %%]" <humidity> (Weather_Chart) {weather="locationId=home, type=atmosphere, property=humidity"}
Number Weather_Humidex "Humidex [SCALE(humidex.scale):%s]" <comfort_level> (Weather)
Number Weather_Temp_Max "Todays Maximum [%.1f °F]" <temperature> (Weather_Chart) {weather="locationId=home, forecast=0, type=temperature, property=max, unit=fahrenheit, scale=0"}
Number Weather_Temp_Min "Todays Minimum [%.1f °F]" <temperature> (Weather_Chart) {weather="locationId=home, forecast=0, type=temperature, property=min, unit=fahrenheit, scale=0"}
Number Weather_Chart_Period "Chart Period"
DateTime Weather_LastUpdate "Last Update [%1$ta %1$tR]" <clock>
DateTime Date "Date & Time [%1$tm.%1$td.%1$tY %1$tr]" <calendar> { ntp="America/Chicago:en_EN" }
// ^^ set ntp to your local time & language
// Other valid examples: ntp="Europe/Berlin" ntp=""
// ntp="America/Detroit:en_EN" ntp="Europe/Berlin:de_DE"
|
|
|
Post by papa on Feb 2, 2016 1:29:26 GMT
How recently did you download the openhab-papa.zip config files?
Early versions had a problem because I used a Windows text editor which handles end of line differently than Linux, Rpi does.
The latest posted version fixed that.
|
|
|
Post by chrisinkc on Feb 2, 2016 2:39:58 GMT
I downloaded it just a few days ago. I'll re-download now and see what happens.
|
|
|
Post by papa on Feb 2, 2016 3:21:46 GMT
openhab-papa.zip from a few days ago should be (mostly) ok. Its files were edited with Notepad++ I just recently installed them on a Linux laptop. I am currently having trouble with the weather-related aspects of the files, but the Node02 stuff is working fine. In general, those files should make no difference between Windows & Linux-Pi You could look at this thread I recently did about installing on Linux. See the Jan 29, 2016 at 11:57am post there for the last thing I had to do for OpenHAB & MQTT to connect & pass messages. The Linux file locations vary a bit from Windows. This thread describes all the things I tried (& the results) when I hit a wall for a while.
|
|
|
Post by chrisinkc on Feb 2, 2016 4:35:34 GMT
I uploaded the latest item file from the openhab-papa.zip and nothing has changed. I looked at papa's thread above and I think I have everything working in regards to MQTT. The gateway and MQTT are connected. The LED stays on. I don't see any error messages in the logs. It just seems like the data from the node is getting to the MQTT but not to OpenHab...
|
|
|
Post by greginkansas on Feb 2, 2016 12:23:48 GMT
Try this format for a item Switch node2motion "Shop door motion " (motion,doors) { mqtt="<[mosquitto:home/rfm_gw/nb/node02/dev08:state:default::]"}
I needed the :: at the end for my items
|
|
|
Post by papa on Feb 2, 2016 14:31:01 GMT
So are you saying that things are working now? & that :: at the end of the item fixed it?
|
|
|
Post by chrisinkc on Feb 2, 2016 21:16:03 GMT
NO, it did not help me. I thought maybe I would try computourist's default OpenHab files found in the Openhab Example folder. This doesn't seem to have made any difference (other than the sitemap changing the browser view). Here is what is looks like now: You can see that the date and time are making it to the interface, but not the temp, humidity, or RSSI from the node. The MQTT LED on the gateway is solid on. I can see the RF LED blink when the node sends data to the gateway. Could there be something wrong with the persistence file? I noticed Computourist did not provide a persistence file. I am still using the one provided by Papa which looks like this: // rrd4j.persist // persistence strategies have a name and a definition and are referred to in the "Items" section Strategies { // for rrd charts, we need a cron strategy everyMinute : "0 * * * * ?" } Items { DemoSwitch,NoOfLights,Window_GF_Toilet,Heating* : strategy = everyChange, everyMinute, restoreOnStartup // let's only store temperature values in rrd Temperature*,Weather_Chart* : strategy = everyMinute, restoreOnStartup }
|
|
|
Post by greginkansas on Feb 3, 2016 0:36:30 GMT
I think the persistence file will just mess up the charts. How about add some rules with logging to see if openhab sees the msgs?
rule "send G2 fiber light proxy" when Item proxy_G_led_2 changed ---your item then logInfo("Green_2_scale 10 sent","Sent " + proxy_G_led_2.state) ----log // sendCommand(G_led_1, proxy_G_led_2) G_led_1.sendCommand(new DecimalType(proxy_G_led_2)) end
|
|
|
Post by papa on Feb 3, 2016 1:26:45 GMT
Regarding the temp & humidity not working: As I've posted recently in my threads, Weather binding seems to have quit working in January. I'm waiting for a 1.8.1 release if add-ons to see if that will fix things.
In the meantime, I've worked out using the http binding to get such weather info via yahoo weather rss. I hope to post it tomorrow.
|
|
|
Post by chrisinkc on Feb 3, 2016 1:59:20 GMT
Papa, just to clarify, you are talking about the temp & humidity not working for your "Weather" Group, correct? This doesn't have anything to do with the node sensor, right?
|
|
|
Post by papa on Feb 3, 2016 2:14:23 GMT
Right, chrisinkc. Weather group & node items AND date/time are separate from each other
Weather comes from an internet weather service via weather binding or http binding.
Node item data come via the gateway from a node.
Date/time come from a NTP server.
Regarding your node troubles ... did you see what I posted above: Disregard the suggestion just above. Your serial monitor output shows things are working. See my next post below.
|
|
|
Post by papa on Feb 3, 2016 2:40:25 GMT
Your serial monitor output shows things are working between MQTT & gateway & node. You've posted your items file. Now post your sitemap file. Perhaps a glitch in the latter is keeping the node data from being posted in the user interface created by the sitemap.
Also look through openhab.log & events.log
On a Linux computer, they're in the /var/log/openhab folder. I assume it's the same on a pi.
In those files you might see something to give you a clue to Google or post here.
|
|
|
Post by chrisinkc on Feb 3, 2016 3:19:33 GMT
Here is my sitemap
sitemap base label="Base House" { Frame label="Controls" { Switch item=OUT2 label="Node 2" icon="light" Text item=STAT2 label="status node 2" icon="lamp" Switch item=OUT6 label="Node 6" icon="light" Text item=STAT6 label="status node 6" icon="lamp" } Frame label="Node 2" { Text item=TEMP2 Text item=HUM2 Text item=RSSI2 } Frame label="Date" { Text item=Date } }
|
|
|
Post by camblonie on Feb 3, 2016 3:24:24 GMT
Text item=Temperature_Node02
You need to reference the same name you gave the number.
|
|
|
Post by chrisinkc on Feb 3, 2016 3:55:32 GMT
Here are the events log and openhab logs from the var/log/openhab folder. Events Log Openhab Log
|
|
|
Post by computourist on Feb 3, 2016 7:03:42 GMT
Hi chrisinkc , your Events.log and openhab.log seem the same ;-) Probably a cut&paste error.. Your problem is in the connection between Openhab and Mosquitto. Your gateway is communicating with Mosquitto, but Openhab is not. In the events log you should see values being uploaded by the node, like so: 2016-01-31 00:02:14 - Node_LastUpdate state updated to 2016-01-31T00:02:14
2016-01-31 00:02:14 - Date state updated to 2016-01-31T00:02:14
2016-01-31 00:02:14 - TEMP2 state updated to 14.00
2016-01-31 00:02:14 - HUM2 state updated to 40.00
2016-01-31 00:02:58 - STAT6 state updated to CLOSED
2016-01-31 00:02:58 - OUT6 state updated to OFF
2016-01-31 00:02:58 - Node_LastUpdate state updated to 2016-01-31T00:02:58
2016-01-31 00:03:00 - getRSSI2 received command READ
2016-01-31 00:03:00 - RSSI2 state updated to -72
2016-01-31 00:04:00 - getRSSI2 received command READ
2016-01-31 00:04:00 - RSSI2 state updated to -73
2016-01-31 00:04:00 - RSSI2 state updated to -71 Since Mosquitto is running, the problem is probably in your openhab config. Did you use the same name for your MQTT broker in your config and item files ? In /etc/openhab/configurations/openhab.cfg under "MQTT Transport" there should be a line like: mqtt: mosquitto.url=tcp://localhost:1883 The same broker name must be used in your item files.
|
|
|
Post by chrisinkc on Feb 3, 2016 15:40:54 GMT
FINALLY!!!
It's working!
Thank you camblonie, for finding the incorrect Text name in the .items file. This was definitely going to be an issue, but the process wasn't even getting that far along to run into that error.
I knew this was going to be a dumb mistake on my part....and it was. My problem was I was missing the MQTT binding! Apparently I had installed all of the other addons, including the openhab-addon-persistence-mqtt, but I was missing the openhab-addon-binding-mqtt.
Amazing how well this works when you correctly install all of the pieces!
Thank you papa and computourist for all of your excellent documentation on this forum. Going back over your threads is how I figured out that I was missing the addon. Thanks to everyone else for your help as well.
Now on to making more nodes...
|
|
|
Post by papa on Feb 3, 2016 16:14:16 GMT
You're welcome, chrisinkc. As I've said before, this project is challenging (many interlocking pieces), but so awesome when it works. I'm glad when my contributions help.
That said, chrisinkc, when you take something related to this project a step or more further, please take the time to share it on this forum. That includes what you may learn from a mistake. Hearing about what works & does not work from different perspectives will likely help newer users who have a variety of perspectives & experiences.
|
|
|
Post by chrisinkc on Feb 3, 2016 16:36:37 GMT
Will do papa!
|
|