Comments (9)
Good news, I solved the problem. As I imagine, the service nexus433
couldn't connect to the remote MQTT server at boot sequence because it was starting faster than the networking was ready (although there is line in nexus433.service
with After=network-online.target
, this doesn't guarantee that a connection with Mosquitto broker is already possible). I added the line:
ExecStartPre=/bin/sh -c 'until ping -c1 192.168.1.8; do sleep 1; done;'
(it waits until it gets a valid ping) before the line: ExecStart=/usr/local/bin/nexus433
in file /etc/systemd/system/nexus433.service
from nexus433.
Beware, the network-online.target
(at least on debian) is not real waiting by default. It must be activated by using systemd's networking or by setting proper WAIT_ONLINE_METHOD
in /etc/default/networking
.
The default one (ifup
) doesn't wait to be really on-line (eg. DHCP can be still in progress). Try to use one of route
or ping
/ping6
method with appropriate related settings...
from nexus433.
After changing configuration file you must restart service (or stop/start program when running from command line).
make install
overrides configuration file with default one. That's the reason you cannot connect to MQTT as there are no credentials in file. Use make install
only once to install files.
from nexus433.
As a matter of fact I modified the file /home/pi/nexus433/nexus433.ini.in with my credentials. So everytime I use make
or make install
the file /etc/nexus433.ini
is written with the right credentials. I wonder if the file /etc/systemd/system/nexus433.service
is ok like this:
[Unit]
Description=433MHz sensor receiver
After=network-online.target
[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/nexus433
[Install]
WantedBy=multi-user.target
Is it possible that the required configuration file is not loaded in time when the Raspbian is booting?
from nexus433.
This happens when you start service manually or only when the board boots up? If this is the second case, most likely MQTT server still does not start when nexus service is running. You must add dependence on MQTT to nexus433.service
(or just a delay).
from nexus433.
Just realised you're running the software on RPI0, so most likely you have no MQTT server on the same machine. My above statement makes no sense.
from nexus433.
Yes, it is the second case, when the RPi0 board boots. The MQTT server is on another machine (Home Assistant on another Raspberry Pi). Something happens during the boot sequence, I have to find a way to check if the nexus433 configuration file is loaded at the right time before connecting to the MQTT server.
from nexus433.
Yes, I suspected this line didn't helped too much for starting nexus433.service
with the proper timing. That's why I tested with the until ping
. Anyway, the gateway is now working perfectly for me, all my "untamed" R8H sensor are now fully integrated with Home Assistant. Thank you @aquaticus for this!
from nexus433.
Probably it would be the best to refactor initial MQTT connection routine to try all the time.
from nexus433.
Related Issues (20)
- CPU usage HOT 2
- no data from temperature sensors HOT 4
- Maximum number of sensors supported?
- Howto use this nexus433 mqtt in Domoticz HOT 1
- Two Nexus433 instances on two Raspberry's HOT 2
- Option to set MQTT client ID HOT 1
- Nexus433 keeps RPi0 W CPU at 99% load HOT 5
- error: "libgpiod needs linux headers version >= v5.5.0" HOT 3
- Request for line input failed. And MQTT not connecting. HOT 2
- Is it safe to connect the receiver using 5V on the GPIO that tolerates 3.3V? HOT 1
- 10th bit in the dataframe HOT 3
- “Request for line input failed” when runnings as addon HOT 5
- error: ‘gpiod_line_close_chip’ was not declared in this scope HOT 5
- Restart nexus433 when Home Assistant is restarted HOT 6
- No unique_id in MQTT messages HOT 2
- In nexus433.ini silent_timeout_sec, but in code silent_timeout_ms HOT 1
- Problem with displaying data from MQTT HOT 6
- MQTT topic `nexus433/sensor/<sensor>/connection` not retained? HOT 2
- Adding encoding info of the nexus protocol HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nexus433.