You should only include the relevant header file in the file Gestion_Porte.hpp, not Mysensors.h
For example
#include <core/MyTransport.h>
You should only include the relevant header file in the file Gestion_Porte.hpp, not Mysensors.h
For example
#include <core/MyTransport.h>
There are two drivers on the RFM69 which aren't compatible. Check if you are using the same one on nodes and gateway.
MY_RFM69_NEW_DRIVER
Also the radio settings have to match.
https://www.mysensors.org/apidocs/group__RFM69SettingGrpPub.html
You need to send the initial state of the sensor
https://www.home-assistant.io/integrations/mysensors/
@dbemowsk You can also use google and add mysensors before the search phrase
If the message is retained, it will show up already when you connect MQTT explorer to the broker, without HA sending a message yet
Could it be the MQTT message is retained? You can use a tool like MQTT explorer to see this
With some logic in home assistant like in an automation or node red, this is possible. Use a helper function to set the state, and request that status from the node
If you are building a presence sensor, take a look at the LD2410.
Also check the review from Andreas Spiess:
https://m.youtube.com/watch?v=dAzHXpP3FcI&vl=en
600000ms is 10 minutes
Perhaps messages gets lost in the other room?
Mysensors is a protocol on its own, so it will not decode your doorbell signal.
An Arduino nano can't be reached over SSH no, the Arduino has a usb connection which gives out serial data to the raspberry
Have you tried a different pc? What about your power supply? It could be the standard nano regulator isn't powerful enough.
@Branther said in Battery voltage sensor is no longer recognized by Homeassistant:
3802 !TSF:MSG:SEND,122-122-0-0,s=1,c=1,t=38,pt=7,l=5,sg=0,ft=1,st=NACK:15.6
3811 !TSF:MSG:SEND,122-122-0-0,s=2,c=1,t=38,pt=7,l=5,sg=0,ft=2,st=NACK:5.7
st=NACK means the message isn't acknowledged by the gateway. So could it be the message isn't received by home assistant?
I mean the ESP framework version, selected by the board version
https://arduino.esp8266.com/Arduino/versions/2.0.0/doc/installing.html#:~:text=Open Boards Manager from Tools,from a drop-down box.
You should try downgrading the ESP version below 3.0
Have your tried googling on ESP32 LoRa?
There are ready made boards that have these, and can run mysensors also. For example the ones from Heltec.
Does this answer your question?
Yes, comment
#define MY_DEBUG
and in setup() add
Serial.begin(115200);
I would recommend to switch to a nrf24l01 or rfm69/95, where you will have bidirectional communication and you can use the mysensors framework
The target is set in the platformio.ini file
upload_port = COM6
I'm not sure about the define your talking about, maybe that isn't needed and the pins are defined in the boards directory. What happens if you define this MYBOARDNRF5?
I've placed the test code here: https://github.com/rikki78/NRF5_test
I hope this helps you!
Have you connected the interrupt pin on the node?
And perhaps tried without the new driver? I don't know how that works with a RPI, does it have an old driver also?
@Stig all right I will have a look but I'm pretty sure I've used the same example, so that should work for you also
This post might help:
https://forum.mysensors.org/topic/9266/guide-nrf5-nrf51-nrf52-for-beginners/54?_=1672252297493&lang=nl
If it doesn't, let me know and I will dig for the exact example
MyBoardNRF5.h/.cpp need to be in src
There is another folder where you have to place the board definitions. I think if you Google on MyBoardNRF5 platformio you will find what you need.
Also checkout this topic https://forum.mysensors.org/topic/9266/guide-nrf5-nrf51-nrf52-for-beginners
@Stig try mqtt-explorer to see what is happening on the mqtt network
@briseis I would just switch back to 2.3.2
I also believe 2.4 on the gateway should work with nodes on 2.3.2. what kind of errors did you get when doing this?
Did you try an earlier ESP 8266 framework version? Perhaps version 3 or even lower?
I'm doing a similar thing, but use node red to inject the values directly to mqtt. This brings more flexibility as it allows any value to be injected, while home assistant checks on values as they are defined in the mysensors protocol specification.
7 should be right. Did you also change the irq number when you tried pin 7?
@DeepCore said in [Help!] Adafruit Feather M0 with built-in RFM69HCW can't find parent / GW:
#define MY_RFM69_IRQ_PIN (3)
#define MY_RFM69_IRQ_NUM (3)
Wild guess... These are not the same normally. Pin 3 is probably interrupt 2, you can find the right one by using
#define MY_RFM69_IRQ_NUM digitalPinToInterrupt(MY_RFM69_IRQ_PIN)
A simple solution would be to weigh the condensate, but I'm not sure whether this is possible (from a mechanical point of view)
great it works!
Here the steps to delete a node are described:
https://forum.mysensors.org/topic/10898/can-t-remove-unused-sensors-from-ha/7
@OldSurferDude can you post your sketch?
Did you follow the presentation and first time sending procedure? https://www.home-assistant.io/integrations/mysensors/
This looks like you're not using the latest (development) version of the mysensors library. That has the latest pubsubclient library included.
Looking at the intervals between the errors again, I'm doubtful if it will make a big difference though. The mysensors library will need to be modified to fulfill your request I guess
@linkinpio said in Building a MQTT Gateway:
client.setSocketTimeout(1);
That is the right syntax, but you have to move the line in setup()
@sn0w This sounds like a floating input, or missing ground wire to me. Is the ground of the sensor connected to the Arduino?
If you want to use library functions outside the main sketch, you can also just include the core header, e.g.
#include "core/MySensorsCore.h"
Yes, that's what I meant. But the value seems to be 2 seconds in your log. Where have you placed the define?
You can also use
setSocketTimeout(1)
On the pubsubclient object.
No, you're right, it doesn't solve your issue. It does increase the availability of the main loop though.
@linkinpio in the pubsubclient library, you can change the timeout on connecting to the mqtt broker. Default it is 15s, reducing it to e.g. 2s will increase the availability of the main loop.
In https://github.com/mysensors/MySensors/blob/master/core/MyMessage.h#L135
S_RAIN is used. As prefix I guess you can use whatever you want, eg mm/h
If you use saveState() and loadState() the library will handle this for you
You have a delay(10000); in the loop() function. To start I would comment that out and see if the issue is solved.
During the delay() nothing can be done. You should use the millis() function to perform time based tasks, that won't block the loop.
@A3V Great thanks I've also bought one and will add radios and sensors to it. Maybe I'll even make the light controllable from the arduino instead, or don't use the light at all. I paid 8€ for this complete light that gives a solar panel, battery and charging circuit. Buying the components is already more expensive I would say
If you have the wrong modules, it could give you problems yes. Check out the buying guide, there are recommendations for the modules to pick, for example the ebyte ones. The will work very reliable. Big advantage of NRF24 to RFM69 is the throughput and response time.
Are you sure the INT pin is connected?
Sending will work, but it will never get an interrupt on recieving a message
You will need to be a bit more specific on what is going on... What is exactly the emission issue you are referring to?
I don't have experience with a Linux gateway, but had a similar issue where the transport was initialised okay and could send, but receiving didn't work.
This was caused by a not connected/working interrupt input (IRQ).
Hope it helps you
This is an interesting find, can you share the link? I can't find these low prices anywhere.
Here the picture of the assembled board. The top board is a temperature sensor so not necessarily needed.
I have tested this board and @salfare observation was right. I had to add a wire to VCC in order to make it work. Just to be sure, I have also cut the connection to DIO5.
The result is a very compact board.
I think I understand what is happening.
The compiler compiles all source files it finds in the folder. So when compiling the sketch itself everything goes fine I think. When the compiler comes across the MyTinySensors.cpp, it tries to compile that file also but can't find the define MY_NODE_ID.
So I think you should move these files to subfolders (like done in the MySensors structure), so they won't be compiled individually anymore. Sounds plausible right?
The only difference I see, is that MY_NODE_ID is not used in MysensorsCore, but only in MyTransport.
It looks like you are close indeed, but I don't get this neither.
I hope someone else can help and let us know if you succeeded...
@Rbonat said in How to pass #define value to library:
MY_NODE_ID
Where have you defined this value exactly?
I've compared your approach to what is done in MySensors.h. In MySensors.h, the cpp file is included instead of the header file.
#include "core/MyMessage.cpp"
If you follow the same steps like in MySensors.h, it should give the same result.
A good start would be to move all the print strings to flash memory, and remove the debug prints as much as possible.
To move strings, change:
display.println("script starting......");
to:
display.println(F("script starting......"));
and do this for all prints. You should try not to exceed 70% memory usage.
I think you have to include the source.cpp in the file MyTinySensors.h
So
#include "source.cpp"
Yes now I understand what you mean, the nodes itself don't go away on my installation either.
You could try with a larger capacitor, close to the radio module
You could try to set a static parent id, in order to determine if this is the case.
Have you also deleted the items from the persistence file?
What do you mean with objects in this case? Entities?
It looks like you're inputs and relays all have the same child IDs, they should be different to be handled correctly by home assistant
Are you sure the messages are received by the node?
I don't assume the relay uses that much power. Do you have more specifications and a wiring diagram?
Shouldn't this define
#define MY_RFM95_IRQ_NUM MY_RFM95_IRQ_PIN
Be
#define MY_RFM95_IRQ_NUM digitalPinToInterrupt(MY_RFM95_IRQ_PIN)
Now the interrupt isn't handled and the received message isn't noticed.
What kind of voltage regulator are you using?
Can you post your node and gateway sketch?
I think you should start with an example sketch, e.g. you don't need the heltec defines I recall.
@pdkwork What is the frequency of the LoRa module you use? 434, 868 MHz?
I have had success with this same board. Which variant of board are you using? So I mean the frequency of the Lora module.
Also make sure you have configured and connected the IRQ pin on the node.
60955 !TSM:INIT:TSP FAIL
This line days the transport couldn't be initialised by the gateway. Check your wiring and/or the module.
Have a look at the bme280. Low power and low voltage and starts at -40 °C
https://www.bosch-sensortec.com/products/environmental-sensors/humidity-sensors-bme280/
It is available on Aliexpress also
A good start would be to post the sketch
With the latest MySensors integration this is how to delete entities:
Hope it helps someone!
@jluvs2ride Somfy uses a rolling code, so recording the code and playing it afterwards will not work since the code is changing all the time. This may help you:
https://www.nodo-shop.nl/en/rflink-gateway/193-rflink-43342-gateway-components-somfy-rts.html
I've had similar issues, which in the end was caused by too little memory.
What's is the memory usage saying? All these print statements require a lot of memory.
What module are you using? There are many flaky ones around.
@keczejo said in Node doesn't recieve message from gateway:
?TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
This looks like the destination is 255. Can you post your node code?
In your configuration.yaml add this
mysensors:
optimistic: true
And restart home assistant
@keithellis flashing onto an esp8266 is still possible, but you have to make sure you use an earlier esp8266 package, below 3.0 IIRC.
Compiling mysensors will give you an error probably, search on it in the forum and you will find more people with the same issue. And how to solve it
Can you post your sketch, and the debug log from your node?
One approach would be to create a separate task on the ESP32 that takes care of testing this sensor, than the gateway is not affected.
Yes it is possible, as long as you use different channels for the communication so the gateways won't be confused. I have two gateways running also (I am using static node IDs), one with nrf24 and the other one with rfm69.
If the delay is not of importance to you, you can also have the sensor request its state from the controller each time it wakes up. No special modifications are needed than.
This is possible yes. In fact I used this setup before, but in the end I stopped using it and separated the gateway from the P1 handling. I noticed very high rates of CRC failures, since the mysensors stuff takes time to handle also, and during this time characters from the P1 port got lost. I should say though that after I separated these, I did some improvements on the P1 decoding which may give better results when it is being used together with the gateway. I didn't send it to mysensors but directly to mqtt.
Tasmota is also able to handle the P1 stream by the way, with a template. https://tasmota.github.io/docs/Smart-Meter-Interface/
Could you try a different USB to serial adapter? Maybe this one is faulty.
@JohnDoe2991
I'm wondering if you have to decode before going to myscontroller
So like this
[
{
"id": "16a94524.a7f49b",
"type": "tab",
"label": "MySensors",
"disabled": false,
"info": ""
},
{
"id": "5ee1d371.4bf144",
"type": "myscontroller",
"z": "16a94524.a7f49b",
"database": "6211fee5.94057",
"name": "",
"handleid": true,
"timeresponse": true,
"timezone": "Europe/Berlin",
"measurementsystem": "M",
"mqttroot": "mys-out",
"x": 870,
"y": 180,
"wires": [
[
"8fd52d51.33df68",
"dfec2cf6.42e45"
]
]
},
{
"id": "c9f3dd7.76aa4a",
"type": "tcp in",
"z": "16a94524.a7f49b",
"name": "MySensors Gateway In",
"server": "client",
"host": "mysensors-gateway",
"port": "5003",
"datamode": "stream",
"datatype": "utf8",
"newline": "",
"topic": "",
"base64": false,
"x": 280,
"y": 180,
"wires": [
[
"dc2b7145.4ea57"
]
]
},
{
"id": "dc2b7145.4ea57",
"type": "mysdecode",
"z": "16a94524.a7f49b",
"database": "6211fee5.94057",
"name": "decode",
"mqtt": false,
"enrich": true,
"x": 460,
"y": 180,
"wires": [
[
"5ee1d371.4bf144",
"d63bd8aa.d34ef8"
]
]
},
{
"id": "9e6d49f6.34fef",
"type": "tcp out",
"z": "16a94524.a7f49b",
"host": "mysensors-gateway",
"port": "5003",
"beserver": "reply",
"base64": false,
"end": false,
"name": "MySensors Gateway Out",
"x": 1490,
"y": 180,
"wires": []
},
{
"id": "8fd52d51.33df68",
"type": "mysencode",
"z": "16a94524.a7f49b",
"name": "encode",
"mqtt": false,
"mqtttopic": "",
"x": 1260,
"y": 180,
"wires": [
[
"9e6d49f6.34fef"
]
]
},
{
"id": "d63bd8aa.d34ef8",
"type": "mysdebug",
"z": "16a94524.a7f49b",
"name": "",
"x": 670,
"y": 300,
"wires": [
[
"4170e76.d577f98"
]
]
},
{
"id": "4170e76.d577f98",
"type": "debug",
"z": "16a94524.a7f49b",
"name": "request",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 660,
"y": 380,
"wires": []
},
{
"id": "dfec2cf6.42e45",
"type": "mysdebug",
"z": "16a94524.a7f49b",
"name": "",
"x": 1070,
"y": 300,
"wires": [
[
"5653b23b.03664c"
]
]
},
{
"id": "5653b23b.03664c",
"type": "debug",
"z": "16a94524.a7f49b",
"name": "response",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1080,
"y": 380,
"wires": []
},
{
"id": "6211fee5.94057",
"type": "mysensorsdb",
"name": "mysensorsnodedb",
"file": "/data/mysensorsnode.db"
}
]
@david-d Andreas Spiess made a nice video for this, I think this is a good place to start:
#383 Cheap and simple Solar Power for our small Projects (ESP32, ESP8266, Arduino) – 14:11
— Andreas Spiess
Are you sure the serial port is not in use by another application?
The ADC needs a fixed reference and usually it uses the vcc for that. Since that is fluctuating, you will get the same value as the value from the resistor divider fluctuates the same.
To overcome this, you should use the internal 1.1V reference. This does mean that your analog voltage from the divider should be below 1.1V if I remember correctly
@nagelc Nice!
What is the PCB you are measuring on? I'm actually looking for a NRF5 board to use with a coin cell.
I am wondering if mysensors is the way to go to automate these blinds. Rflink, for example, supports this brand and could be connected to your home control system to control these motors.
http://www.rflink.nl/blog2/devlist
This looks good to me...
So if you add an entity card now, and type sensor, it should show up this new TestSensor also. Doesn't it show up in the list?
Yes I have home assistant but don't have the build essentials. I did some more reading and it seems like a package of build tools. Perhaps @tbowmo knows which specific one is needed?
In Home Assistant you have the Node Red configuration (under supervisor). There you can add packages to be installed under system_packages: []
Good to hear! Perhaps a GitHub issue should be raised for these points...
It looks like sensor.begin() doesn't return a value
Yes, but now use the 2.3.2 release with this modification
And if you change the lines like below now?
@smilvert said in GWT:TPC:CONNECTING:
it dosen't. But when I changed the delay to 3000
bool gatewayTransportConnect(void)
{
#if defined(MY_GATEWAY_ESP8266) || defined(MY_GATEWAY_ESP32)
if (WiFi.status() != WL_CONNECTED) {
GATEWAY_DEBUG(PSTR("GWT:TPC:CONNECTING...\n"));
delay(3000); // Was 1000
return false;
}
GATEWAY_DEBUG(PSTR("GWT:TPC:IP=%s\n"), WiFi.localIP().toString().c_str());in MyGatewayTransportMQTTClient.cpp then it started to work!