|
Post by papa on Jan 26, 2024 14:52:18 GMT
Yes, sometimes starting over may be the fastest way to fix things. I'm glad it's working so far.
|
|
|
Post by papa on Jan 25, 2024 2:08:10 GMT
Thanks for updating. You are Welcome. Glad you stopped by.
|
|
|
Post by papa on Jan 22, 2024 16:15:34 GMT
Re: Habpanel troubles
As I described in this thread, my habpanel did not work when I upgraded to openHAB 4. Moreover, OH 4 requires Java 17 which was not compatible with my old OH computer. As described there, my fix was to roll OH back to a later version of OH 3. Sometimes when OH has a major update, configurations from a previous version may not work. If that's the case for you now, you might do this: Roll back OH to an OH 3 version. Then take careful notes about your habpanel configuration. Upgrade to OH 4. Then use your notes to manually recreate your habpanel.
Somewhat starting over can also help clean up OH.
At this point, I'm not sure what else to tell you. I won't be ready to upgrade to OH 4 for at least several months until when I install it on a newer computer.
|
|
|
Post by papa on Jan 21, 2024 2:38:44 GMT
On OpenHAB App, Getting Access to
Choosing a Saved Habpanel Configuration
Welcome, Guest. For more benefits, I hope you register as a member (no charge).
It's been a while since I have edited my habpanel & put it on my mobile device. See if the following helps getting you started.
You are right that the gear icon is not on the openHAB app. Getting access to set up is a little different than on the PC.
Watch this short video (it goes fast so you may need to stop & start). It's an old video but will give you some idea of fields you need to fill (parallel to setting up habpanel on your PC.) Close the mobile openHAB app. Reopen it. (Maybe while the app is loading,) look for a stacked horizontal lines icon (shown enlarged just below) near the upper left. Click on that icon. In the resulting list, scroll down to & click "settings." There you should see links to fields you need to field & on/off switches for settings. I hope that helps.
|
|
|
Post by papa on Dec 23, 2023 21:29:13 GMT
Update Linux without Breaking OpenHAB Terminal Commands:
sudo apt-get update sudo apt-get upgrade The result from the hold was openHAB was working fine. I could get the openHAB interface in my browser. Disadvantage: We miss any updates in openHAB 3. The method in this post could update Linux & the latest openHAB 3 version without breaking openHAB
|
|
|
Post by papa on Dec 23, 2023 21:25:09 GMT
Using dpkg with OpenHAB Preliminary precaution: As shown here, do a backup of the openHAB configuration. Display the Status of openHAB (install latest update)
[terminal command:] dpkg --get-selections openhab [result:] openhab install Command openHAB to hold at it's current version
[terminal command:] echo "openhab hold" | sudo dpkg --set-selections [enter Linux password] Display the Status of openHAB (hold, don't update)
[terminal command:] dpkg --get-selections openhab [result:] openhab hold Display All Packages on Hold
[terminal command:] dpkg --get-selections | grep "\<hold$" [result:] openhab hold Next: Update Linux without Breaking OpenHAB
|
|
|
Post by papa on Dec 23, 2023 21:17:46 GMT
A Different Approach Avoid an Update of OpenHAB Until We're Ready
As said earlier, I only use Linux for openHAB & Arduino IDE. So I learn more about Linux when I need it. I researched how to update Linux, but avoid updating certain packages. This site gave several methods to prevent updating of a specific package. I used only the first method, dpkg. See the following ways to use dpkg.
Put a package on hold: echo "<package-name> hold" | sudo dpkg --set-selections
Remove the hold: echo "<package-name> install" | sudo dpkg --set-selections
Display the status of all your packages: dpkg --get-selections
Display the status of a single package: dpkg --get-selections <package-name>
Show all packages on hold: dpkg --get-selections | grep "\<hold$"
Next: Using dpkg with OpenHAB
|
|
|
Post by papa on Nov 18, 2023 20:04:22 GMT
Followup According to this post & its thread, the warning about Java 17 is wrong. Java 11 is still OK for OpenHAB 3.
Seems like Java 17 might mostly work with openHAB 3, but cause some problems.
Next: A Different Approach
|
|
|
Post by papa on Nov 17, 2023 19:36:50 GMT
Java 17 ?? & a Working OpenHAB
From the Terminal message just above, I thought, "Oh, I must install Java 17." I tried to install the recommended Zulu 17. I was told that there is no version for my machine. Before I tried another flavor of Java 17, I tried to raise the openHAB interface on my browser. Yay, after the openHAB downgrade, everything seems to be working fine. For now, I did not further try to upgrade to Java 17.
Bottom Line Thoughts
In doing typical Linux updates, openHAB will also be "upgraded," possibly to a broken condition. As shown above, downgrading to a previous openHAB version may fix the problem.
Did my upgrading Linux & openHAB fix the original problem (Gateways disconnecting from the MQTT broker)? I'll be watching to see
|
|
|
Post by papa on Nov 17, 2023 16:49:18 GMT
How I Recovered OpenHAB More research suggested downgrading openHAB to a more stable (& compatible) version. Preliminary precaution: As shown here, I did a backup of my openHAB configuration. Using Linux Terminal, I followed the downgrading directions in the official openHAB docs:
apt-cache showpkg openhab showed several available versions from openHAB 3.0.0-1 to openHAB 4.0.0-1. Before openHAB 4.0.0-1 were versions 3.4.4-2 & 3.4.4-1
In Linux Terminal, I executed sudo apt-get install openhab=3.4.4-1 The results in Linux Terminal: Next: Java 17 ?? & a Working OpenHAB
|
|
|
Post by papa on Nov 17, 2023 16:36:30 GMT
The Problematic Fix
As I said, Linux had bugged me about updating, so I gave that a try in Linux terminal:
The result was openHAB was broken. I could not get the openHAB interface in my browser. The openHAB log showed many errors.
What Went Wrong?
Linux upgraded openHAB along with the rest of the installs. Since I had not instructed Linux otherwise, it upgraded my openHAB 3 to the latest openHAB version, an early version of a major upgrade: openHAB 4. According to my research, openHAB 4 is not that reliable yet. Moreover it requires Java 17 not Java 11 as before.
Next: How I Recovered OpenHAB
|
|
|
Post by papa on Nov 17, 2023 16:26:24 GMT
Introduction A couple years ago, I installed Linux & openHAB 3 on an older laptop (See here.) When things are going OK, I generally let them run. This is especially true with Linux which I only use for openHAB & Arduino IDE. When one is unfamiliar with something, trying to fix one problem can lead to other problems. Other than Linux bugging me about updating, the system had been working well. Then a few months ago, my gateways starting losing connection with the MQTT broker (Mosquitto). A Linux reboot & a manual correction of one variable took care of things. However that disconnect problem began reoccurring every month or so. The problem & fix were a little annoying, but could be more serious when I was away from the computer & could not reboot it. The following describes how I tried to fix the problem, how the "fix" did cause (worse) problems, & how I recovered openHAB (I think). Next: The Problematic Fix
|
|
|
Post by papa on Jun 29, 2023 10:14:04 GMT
I'm glad you stopped by, serhio, & letting me know that you benefited from what is offered here.
|
|
|
Post by papa on Jun 1, 2023 20:26:12 GMT
Some Forum Threads on Controlled Irrigation via MQTT
Disclosure: The following forum material has not been updated for a while. I don't currently have the time or motivation to do so. But it should give you some adaptable ideas of how you might proceed. I recommend you read threads all the way through before you attempt to follow them. Later posts may change what was posted earlier. This thread covers building a WiFi RFM69 Gateway. This thread covers the automated irrigation that I had implemented. (I have reverted to manual control of irrigation.) Note: Moisture probes of solid copper might be more reliable than stainless steel. An older thread on automated irrigation A thread about soil moisture & temperature sensing.
|
|
|
Post by papa on Jun 1, 2023 20:21:17 GMT
I have a project to do controlled irrigation via MQTT, I saw that you have a project with Gateway Mqtt, could you help me? Helping me with an orientation? ======================== diegopcbs, "controlled irrigation via MQTT" is a challenging project. For orientation, I will describe some possibilities, some components, & some warnings.
An initial warning: This project risks over watering & under watering. 1) An electrically-controlled valve connected to your water supply pipe. The valve I've used takes an AC power supply of 24 volts. Also needed is a DC to AC relay for the (DC) node to switch on the AC power to the valve. 2) A remotely communicating device to switch the relay/valve ON & OFF. A WiFi device may be too far from one's WiFi router to connect reliably. Instead I have used an Arduino node that communicates via an RFM69 radio. An RFM69 radio node needs an RFM69 gateway for two-way communication with a computer's MQTT. This forum (see below) has docs on building & programming the node & a WiFi/RFM69 gateway. 3) Some kind of computer based control software is needed. For Windows & Linux computers, this forum has installed Mosquitto MQTT communication & openHAB with a MQTT binding. There are also openHAB apps for phones. 4) The above hardware & software would allow one to remotely control water flow ON & OFF via a virtual openHAB button or openHAB-scheduled timers. 5) Also needed are ways to protect the electronics from water. 6) What if you want to add received rainfall as a factor? This makes the openHAB programming more complicated. I once implemented that. However it became difficult to obtain the needed information from internet weather services. 7) What if you want to add soil moisture as a factor? Again more complicated programming. Also after trying a couple methods, I found it challenging to electronically measure soil moisture. In my soil conditions, capacitive soil moisture sensors were very unreliable. I had the best (but not fully reliable) results from resistance-based soil moisture sensors. A final warning: This project risks over watering & under watering. For one fail safe, I programmed the node to turn off water if the node lost contact with the gateway.
Next: Some Forum Threads on Controlled Irrigation via MQTT
|
|
|
Post by papa on May 2, 2023 21:09:34 GMT
RFM95 Nodes to Communicate with ESP32 WiFi Gateway (SPI_1 or SPI_2 Bus)
|
|
|
Post by papa on May 2, 2023 21:08:07 GMT
Prepare to Program the ESP32-RFM95 Gateway, Version 2 Latest Version
^^ Corrected public version, May 2, 2023 ^^ RFM95 DIO0 interrupt pin moved from ESP32 pin 5 to ESP32 pin 25
Open the Arduino IDE (program for loading, editing, & uploading Arduino sketch programs). From the Arduino IDE, open the sketch (program) file downloaded above. Accept the sketch's being put in a subfolder. Before uploading (sending) the Gateway sketch to the Gateway, you must edit it to customize to your situation. Your IDE computer must also have the additional code library files that the Gateway sketch needs. The following offers guidance.Note: In editing a sketch, sometimes we are told to "comment out a code line" which means put two forward slashes ("//") at the start of the code line to make the rest of a line a "comment" (not programming code) & disables the code. To UNcomment a line means to remove the two forward slashes ("//") at the start of the line to make the rest of the line into working code except "//" later in the line still indicates comment there. For example in the Gateway sketch, see "// #define DEBUGRADIO" which is a comment, not active code. The line "#define DEBUG // uncomment for MQTT debugging" starts with active code & ends with a comment (after //). Adapt this post to download & install the Radiohead & encrypt library files. Place the files in the same file folder as the Gateway sketch. Then to this Gateway sketch, add this customization: To use the secondary SPI bus, find the line "#define Alt_SPI" & UNcomment it (remove // at the line's start). If commented, the sketch uses the primary SPI bus. To see the related programming, search for "ifdef Alt_SPI" PS If you leave #define Alt_SPI commented, the code should work on an ESP32 board that uses the primary SPI bus.
|
|
|
Post by papa on May 2, 2023 21:04:42 GMT
A Two-Way RFM95 Gateway with WiFI & MQTT, Secondary SPI BusThe following wiring diagram for the two way RFM69 Gateway (version 2) is similar to one above, EXCEPT the RFM95 radio is connected to the ESP32's secondary SPI pins. Especially for when the Gateway will be disconnected from the Serial Monitor, one steady-burning LED will signal that WiFi/MQTT is connected. The flashing LED signals when radio communication is happening. For each LED, the originally shorter pin goes into an ESP32 ground. Each originally longer pin goes into the ESP32 pin designated in the Gateway sketch. For hints about parts, code libraries, etc., see posts starting here. Disregard references to ESP32 pins (primary SPI bus). As able, you may change the ESP32 pins for the LEDs, but you must also change the pin numbers in the Gateway sketch (see below). Unfortunately the HiLetgo OLED ESP32 board seems to have limited pins available.
On May 2, 2023, the wiring diagram was updated. The RFM95 DIO0 was moved from ESP32 pin 5 to ESP32 pin 25 because ESP32 pin 5 is an I2C pin used for the mounted OLED.
<< Members, click on pic for larger view. Next, Prepare to Program the ESP32-RFM69 Gateway, version 2
|
|
|
Post by papa on Apr 27, 2023 19:55:54 GMT
Update, WiFi_RFM95 Gateway, Using Secondary SPI Bus
I worked out how to implement gateways on ESP32 boards where the primary SPI bus is not available (like the HiLetgo OLED ESP32).
The following posts will document necessary changes in wiring & coding.
PS If properly customized the Gateway code below should work on an ESP32 board that uses the primary SPI bus (e.g. Sparkfun ESP32 Thing).
Next, Wiring an ESP32 Gateway for the Secondary SPI Bus
|
|
|
Post by papa on Apr 25, 2023 21:56:05 GMT
Thanks for checking in, fito, & expressing your appreciation. I hope this forum's contents are helpful to you.
Papa
|
|
|
Post by papa on Apr 23, 2023 21:43:34 GMT
Followup Notes I assume the HiLetgo OLED ESP32 board uses the primary SPI bus for something. I don't know yet. I believe that one can use both of an ESP32's SPI buses.
Something like this post might help point the way.
|
|
|
Post by papa on Apr 23, 2023 21:14:59 GMT
Prepare to Program the ESP32-RFM69 Gateway, Version 2 Latest Version
^^ slightly updated, May 2, 2023 RFM69 pin DIO0 moved from ESP32 pin 5 (needed by OLED) to ESP32 pin 25
Open the Arduino IDE (program for loading, editing, & uploading Arduino sketch programs). From the Arduino IDE, open the sketch (program) file downloaded above. Accept the sketch's being put in a subfolder. Before uploading (sending) the Gateway sketch to the Gateway, you must edit it to customize to your situation. Your IDE computer must also have the additional code library files that the Gateway sketch needs. The following offers guidance.Note: In editing a sketch, sometimes we are told to "comment out a code line" which means put two forward slashes ("//") at the start of the code line to make the rest of a line a "comment" (not programming code) & disables the code. To UNcomment a line means to remove the two forward slashes ("//") at the start of the line to make the rest of the line into working code except "//" later in the line still indicates comment there. For example in the Gateway sketch, see "// #define DEBUGRADIO" which is a comment, not active code. The line "#define DEBUG // uncomment for MQTT debugging" starts with active code & ends with a comment (after //). Adapt this post to download & install the RFM69X code library files. Place the files in the same file folder as the Gateway sketch. Then to this Gateway sketch, add this customization: To use the secondary SPI bus, find the line "#define Alt_SPI" & UNcomment it (remove // at the line's start). If commented, the sketch uses the primary SPI bus. To see the related programming, search for "ifdef Alt_SPI"
|
|
|
Post by papa on Apr 23, 2023 19:47:49 GMT
A Two-Way RFM69 Gateway with WiFI & MQTT, Secondary SPI Bus Updated May 2, 2023 RFM69 DIO0 Interrupt Pin moved from ESP32 pin 5 (needed by OLED) to ESP32 pin 25
The following wiring diagram for the two way RFM69 Gateway (version 2) is similar to one above, EXCEPT the RFM69 radio is connected to the ESP32's secondary SPI pins. Especially for when the Gateway will be disconnected from the Serial Monitor, one steady-burning LED will signal that WiFi/MQTT is connected. The flashing LED signals when radio communication is happening. For each LED, the originally shorter pin goes into an ESP32 ground. Each originally longer pin goes into the ESP32 pin designated in the Gateway sketch. For hints about parts, code libraries, etc., see posts starting here. Disregard references to ESP32 pins (primary SPI bus). As able, you may change the ESP32 pins for the LEDs, but you must also change the pin numbers in the Gateway sketch (see below). Unfortunately the HiLetgo OLED ESP32 board seems to have limited pins available. << Members, click on pic for larger view. Next, Prepare to Program the ESP32-RFM69 Gateway, version 2
|
|
|
Post by papa on Apr 23, 2023 19:36:43 GMT
Update, WiFi_RFM69 Gateways in Operation
Recently, after several years of service, my Arduino Ethernet RFM69 Gateways became unreliable. Using Sparkfun ESP32 Things as described above, I created & deployed two new WiFI RFM69 MQTT Gateways. They seem to work well communicating with my Arduino RFM69 nodes, except that the computer hosting openHAB & Mosquitto is acting flaky in staying connected to my LAN.
While I was refreshing myself in building these WiFi gateways, I worked out how to implement gateways on ESP32 boards where the primary SPI bus is not available (like the HiLetgo OLED ESP32). The following posts will document necessary changes in wiring & coding.
Next, Wiring an ESP32 Gateway for the Secondary SPI Bus
|
|
|
Post by papa on Jan 3, 2023 21:40:20 GMT
Save / Backup Your HABPanel Configuration in a .json file
Have a file to reproduce settings you created for HABPanel. It can be used to restore those settings to your current machine or to transfer to another machine.
Go to http://localhost:8080/habpanel/#/
At the top left of the HABPanel screen, click on the "stacked pages" icon. Then at the bottom, click on the gear icon.
<< Click on Edit local panel configuration.
<< Click on the Export button.
This will give you the opportunity to save the file habpanel-config.json. I recommend that you add a date to the file name. Save to a location you can find.
To bring this HABPanel config into your current machine or another, use the Import button & navigate to where you stored the .json file.
|
|
|
Post by papa on Oct 31, 2022 15:42:26 GMT
Display a Node's DHT Data on HABPanelGo to the browser address localhost:8080. At the upper right are two small icons, a pencil & a "page." Hovering the mouse pointer over the pencil shows "Edit Home Page." Over the "page," shows "Other apps." Click on the "Other apps" icon & then click on HABPanel. The browser address becomes " http://localhost:8080/habpanel/" The first time you use HABPanel, click the gear icon at the upper right. At the middle left, click on "Add new dashboard." For the new dashboard, enter a Name, perhaps "Main" & click OK. (I assume Node36 & a dashboard named "Main." Yours may differ.) Hover the mouse pointer over "Main" at the upper left. Click on the small pencil icon (edit dashboard) that appears. At the upper right, click on the [Add Widget] button. In Add Widget, choose Dummy (useful for text). In the new widget window at the upper right, click the 3 stacked dots. Choose Edit. Enter a Name, perhaps Node36temp. In the openHAB Item field, choose the desired Item to link. You can click the drop down icon & scroll down to the Item named Temp_Node36. OR you can enter Temp_Node36 in the search box. Either way, click on the Temp_Node36 Item listed. For the Unit (suffix) field, enter °F or °C. Scroll to the bottom of the Edit Widget Window & click [ Save]. Add another Dummy widget. Edit it. Enter a Name like Node36humid. In the openHAB Item field, choose the related Item like Humidity_Node36 For the Unit (suffix) field enter %. Save.
Click the [Run] button to see "Node36temp" & "Node36humid" widgets in the Main dashboard. If the node is programmed & powered, the DHT temperature & humidity readings should be displayed on the widgets. Note: There is a way to combine the temp & humidity readings in one widget. I may add that later.
|
|
|
Post by papa on Oct 28, 2022 22:58:30 GMT
ESP32 DHT Sensor Node, Correcting Errors & ProblemsThe software sketch here has changed to avoid sending Temp & Humidity values with leading spaces. Those don't play well with an openHAB Number Item. In the above posts, see " corrected Oct. 28, 2022" for other necessary changes. Next, Display Node36's DHT Data on HABPanel
|
|
|
Post by papa on Oct 27, 2022 21:19:35 GMT
Create Items to Link to Node36's Channels 48 & 49, My Preference: Text Config File
Remember: Use only one method to create & edit an Item (Dashboard OR .items file) NOT BOTH. This method both creates the Item AND links it to the Node36 Thing's Channel 41. [Your node & Thing may differ.]
In openHAB's items folder (Linux /etc/openhab/items), have an .items file to hold the Item. Mine is called ESP32.items, but the name before the .items tag is up to you. The channels' Item takes the form: [ Your Item's Name & Label could differ.] Number Name "Label [%s]" { channel=" Node36channelUID" } Go to localhost:8080/settings/things/ Click on the listed Node36 Thing Click on the [ channels] tab After the Node36_RSSI channel is a small stacked pages icon. Click on that icon to copy the channel UID Into the Item, paste that channel UID in place of Node36channelUID color-coded above. For example, my channel's UID is mqtt:topic:c08f02ca8d:3f938be488:Node36Channel41
So my Items (your channel UID & perhaps your nodeID for the Item will be different) are
Number Temp_Node36 "Temp_Node36 [%.1f °F]" { channel="mqtt:topic:c08f02ca8d:3f938be488:Node36Channel48" } Number Humidity_Node36 "Node36_Humidity [%d %%]" { channel="mqtt:topic:c08f02ca8d:3f938be488:Node36Channel49" } ^^ corrected Oct. 28, 2022
For display purposes only, go to localhost:8080/settings/items/Temp_Node36 & localhost:8080/settings/items/Humidity_Node36 Look at the field just below the top brightly-colored rectangle. If our Node is programmed & powered, those fields should display the Node36's Temperature & Humidity states.
Next: ESP32 DHT Sensor Node, Correcting Errors & Problems
|
|
|
Post by papa on Oct 27, 2022 20:07:31 GMT
Create Node36 Channel for Device 49 (Humidity)
A Node36 with DHT sensor also publishes air humidity (per cent). Configure its channel like the Temperature channel.
In the Add Channel Window, fill the fields with configs:
Channel identifier Node36Channel49 ^^ arbitrary ? as long as we match it in a linked Item (see below)
Label Node36_humidity ^^ arbitrary ?, make it useful for yourself, but not too long
Channel type Number Value ^^ choose type compatible with the device/channel data type
MQTT State Topic home/esp_gw/nb/node36/dev49 << corrected Oct. 28, 2022 MQTT Command Topic [Leave blank]
Click [Create] to save your configs
Next: Create Items to Link to Node36's Channel 48 & 49
|
|
|
Post by papa on Oct 27, 2022 20:04:51 GMT
Create Node36 Channel for a Node's Devices 48 (DHT temp) & 49 (DHT humidity) [Your node ID may differ.]I'm adding a channel to a previously created Thing Node36. To create a different Thing, see here. See this post. We're making a channel for the MQTT topic: home/esp_gw/nb/node36/dev48
Logged in to your openHAB configuration, go to localhost:8080/settings/things/In the listed Things, click Node36. Then click the [channels tab] near the top. Near the bottom, click Add Channel. In the Add Channel Window, fill the fields with configs: Channel identifier Node36Channel48 ^^ arbitrary ? as long as we match it in a linked Item later (see below) Label Node36_Temp ^^ arbitrary ?, make it useful for yourself, but not too long Channel type Number Value ^^ choose type compatible with the device/channel data type MQTT State Topic home/esp_gw/nb/node36/dev48MQTT Command Topic [leave blank] Click [Create] to save your configs Next: Create Node36 Channel for Device 49 (Humidity)
|
|