I don't know how to add additional script to gateway sketch. Maybe someone else from MySensors community could help.
Posts made by gieemek
-
RE: RS485 transport ACK support
-
RE: RS485 transport ACK support
@cabat, @rozpruwacz is right: I don't use the noACK function.
But I do use send(msg) function with an echo parameter set to true, which forces the gateway to send echo back to node.
How it works:- When the node starts sending message, the variable isSent is set to false.
- The node's send(msg) function runs in a loop for up to 5 repetitions unless the isSent variable changes to true. The function repeats sending message every 1 second.
- The receive() function on the node reads the messages from the gateway. If it is is.Echo() it sets the isSent variable to true. This interrupts the loop with send(msg) function.
Important ! you need to wait about 0,5 s after sending message to get echo back from gateway.
bool isSent; void loop() { // your other code in loop() function isSent = false; while ( ! isSent && i < 5 ) { send( message.set( value ), true ); wait( 500 ); if ( ! isSent ) { wait( 1000 ); } i++; } // your other code in loop() function } void receive( const MyMessage& message ) { if ( message.isEcho() ) isSent = true; else doSomething; }
-
RE: RS485 transport ACK support
ACK response in implemented in RS485, I'm using it.
-
RE: OH3 - MySensors Binding
Hi,
I don't use MySensors binding so I have not tested it in OH3. But I know, that there are not binding special for OH3. All binding 2x should work with OH3. Difference is with binding 1x - these are not working with OH3. -
RE: Best radio type for 5 floor communication
From my experience (I have more then 10 nodes with RFM69 HCW 433Hz - I've choosen it according better penetration by walls and slabs). All nodes working with standard wire antenna.
- My nodes inside the internal garden (distance about 15 m to the gateway with one glazed wall (aluminium structure)). They work with maximum power of signal and my RSSI is about -95 dB (poor). Sometime I lost the signal which is very frustrating.
- Node at upper level than the gateway (distance about 4 m, reinforced concrete slab between). RSSI is about -86 dB and signal is stable (signal breaks are rare).
What I can say after three years using RFM69:
- distance inside the building is short (to about 15 m, stable signal to 10 m or less)
- sometime signal is lost and it depend from different reasons (ie. weather - yes, inside the building too)
- nodes or gateway should be at hight min. 1 m above the slab (heigher is better)
- nodes should be away from other transmitter (ie. wifi router)
- I have experimented with different kind of antennas but without big success (but still wire antennas, not with directional ones)
I have built few nodes with NRF24L01 but I couldn't use them at all - very short range in my house. That's why I've choosen RFM69 (a little bit better).
I'm not happy with RF modules and now I try to jump to RS485 system by wire (I have alarm system I don't use and I try to adopt it). So I'm glad that MySensors have RS485 gateway now. I have built 4 simple nodes with RS485 modules and they work for couple of months without problems. And they work with star typology up to 17 m. Thank you MySensors !
-
RE: Possible to have an external power source for moisture sensors??
I have MySensors node with 5 moisture sensors - work without problems for one year.
Node platform:- Arduino Pro Mini 5 V
- RFM69HCW powered by 3,3V voltage regulator + resistors on communication lines
- 5x FDRobot moisture sensors
- 3x DS18B20 temperature sensors
powered by 5V, 1A power supply
-
RE: RFM69HW - Wow, I didn't expect this range
I use RFM69HW 433 MHz with a wire antenna (straight or spiral). When I start to test my devices, I had a range of about 100 - 150 m (transmitter in my house, receiver outside), so it was very good result for me.
Unfortunately, after building the nodes, now I have the stable range less than 10 m inside my house (I use maximum MY_RFM69_MAX_POWER_LEVEL_DBM (20)). Sometimes it is better, sometimes worse, it depends on various conditions.
Congratulations on such good results of your gateway, but I'm afraid that stable transmition will be much smaller. -
RE: RFM69 RSSI value report
I do not know Domotich - I am working with openHAB through MQTT protocol, which simply reads the sent value of variable and does not wonder what type they are. Yes, I use S_CUSTOM variable to send RSSI value.
But it really doesn't matter what kind of variable you use. The variable type tells to MySensors that its value is for example: light level, temperature, or voltage, but you can send a temperature value using the S_POWER variable - no problem with that.
RSSI should be expressed as an integer, so what is realy important that you choose the variable type declared as integer value, such as i.e. S_LIGHT_LEVEL.
Once you have that value in the controller (openHAB), you can do whatever you want with it.
So it is in openHAB, and I hope in Domoticz the same. -
RE: RFM69 RSSI value report
In the 2.2 version of MySensors (development branch) the new driver for RFM69 is built. It has new command for reading RSSI value: RFM69_getSendingRSSI() and RFM69_getReceivingRSSI(), so now is very easy to get RSSI value.
You can get some more information from ATC Signal Report which are useful - look at RFM69_RFM95_ATC_SignalReport example. -
RE: MQTT - RFM69 Gateway stops communicating randomly and doesn't recover
@Carywin OK, my gatewayMQTTclient with RFM69 via SoftSPI is working now. There was a problem in RFM69_new.cpp file with SPI_HAS_TRANSACTION variable which is defined in hard SPI.h but not in SoftSPI.
Now I test my gateway and I hope it will work without losing connection. Thank you once more for help. -
RE: MQTT - RFM69 Gateway stops communicating randomly and doesn't recover
@Carywin The problem with compiling by Arduino is with softSPI. When I switch it off my sketch is compiling properly. I have to implement softSPI library to new driver. Thanks.
-
RE: MQTT - RFM69 Gateway stops communicating randomly and doesn't recover
@Carywin Is your gateway still working without losing connection ?
I have the same problem as yours: my gatewayMQTTclient with RFM69 by softSPI is losing connection with nodes. Sometimes it works by couple of days, sometimes only few hours.
I have tried to implement new RFM69 driver version of MySensors (2.2 dev), but arduino has not compiled my sketch according to errors in RFM69_new.cpp file (some variables are not defined). With old driver version sketch has compiled.
How have you run your gateway with MySensors 2.2 ?
Have you defined MY_RFM69_NEW_DRIVER parameter to work with new driver ? -
RE: Still searching for a working Ethernet GW with RFM69
It is possible to use RFM69 radio via SoftSPI which allow to build gateway with W5100 or ethernet shield. You need to change RFM69 driver and MyConfig.h configuration file.
I put modified these files at github repository: https://github.com/gieemek/RFM69_softSPI-for-MySensors-2.1.1
You can find instruction how to prepare gateway sketch at this repository too.
My gateway (as MQTT client) with ethernet shield and RFM69 radio via SoftSPI is working for 10 days without any problems. -
RE: No softspi support for RFM69
I modified MyConfig.h file and RFM69 driver to allow you build gateway (ethernet or MQTT) with W5100 ethernet and RFM69 radio modules using SoftSPI bus. You can find it at: https://github.com/gieemek/RFM69_softSPI-for-MySensors-2.1.1
-
RE: No softspi support for RFM69
Modifications were easier than I expected, only that I am successfull (I'm not a programmer).
For now, the program did not switching between soft and hard SPI and I fail to realize it fast - really frequently change the file is uncomfortable.
I want to send my library to LowPowerLab to check it.
If you are interested in further modification of this library, I can send you by mail a list of changes I made. -
RE: No softspi support for RFM69
@gieemek said:
I'm using Arduino Mega in my gate because I want to add LCD display in the future . Uno has too little ram to do it.
Now when I compile MQTTgateway sketch with my RFM69 soft spi library in the arduino ide it takes 18 838 bytes, variables 882 bytes, so this should be fit for Uno.Ooops, I have made a mistake. My MQTTGateway.ino sketch with RFM_softSPI library compiles to 28 474 bytes, variables 1 003 bytes. Sorry for my earlier notes.
-
RE: No softspi support for RFM69
@TD22057 said:
Thanks. Chat message sent w/ my email to get the files. I won't have time to mess with the radios until next week but then I can set up a git pull request with your changes if you like. I decided to spend the $7 and get a Mega for my gateway and duplicate your set up (except w/ the MqttClientGateway). Did you apply the ethernet shield reset fix to the mega+ethernet? More info here: http://forum.mysensors.org/topic/1021/security-introducing-signing-support-to-mysensors/156
I don't need to reset my gateway after power lost (Arduino Mega 2560 + ethernet shield + RFM69HW radio) - everythng working good.
-
RE: No softspi support for RFM69
OK, finally I put my library and files at GitHub repositories. You can find it at https://github.com/gieemek
-
RE: No softspi support for RFM69
I had no problems with resetting the gate so far, but I must point out, if I have this problem.
-
RE: No softspi support for RFM69
I'm using Arduino Mega in my gate because I want to add LCD display in the future . Uno has too little ram to do it.
Now when I compile MQTTgateway sketch with my RFM69 soft spi library in the arduino ide it takes 18 838 bytes, variables 882 bytes, so this should be fit for Uno. -
RE: No softspi support for RFM69
I was able to implement the module RFM69 on a soft spi (RFM69 only for now). It is not very complicated. If anyone is interested, I can post a description how to do this, or I can send the ready files. Unfortunately, I did not use GitHub yet and not posted files there - I'll try to do it as soon as I can.
I use modules RFM69W and RFM69HW as radio modules. As the gate I use MySensors MQTTgateway (Arduino Mega 2560 R3 + ethernet shield + RFM69HW). Everything works pretty well and I can build an entire network of sensors based on MySensors libraries.