Posts made by adrianmihai83
-
Info about String Payload
I am intrigued by the following thing, I want to send a string to the controller, tried in many things but I don't seem to get one thing. To be short, I want to send to the controller a string containing 14 bytes, more exactly the ID of the RFID Tag. If I am sending this way:
gw.send(msgRfTag.set("24848484852515754685348483"));
everything goes well.
But if I want to do the following:
String strTag = "24848484852515754685348483";
gw.send(msgRfTag.set(strTag));it does not compile, error: no matching function for call to 'MyMessage::set(String&)'
I use Arduino 1.5.8, on Windows enviroment, latest library.
-
RE: Software serial Library
I get the same error when using the SoftwareSerial library. More specific, it is a known limitation that you cannot use SoftwareSerial.h and PinChangeInt.h together without altering one or another.
Let me give you an example, I was in the same case as you are now, I wanted to use an RF ID reader (125 kHz - RDM6300) on a software serial pin, in my case was A2 (don't ask why, this was the only input pin that I have on an UNO, it is stuffed with keyboard, display, motor actuator for door opening, button for manual door opening, ringer button and NRF24 - this is my all in one entrance sensor ). So, what you have to do:
pin A2 is on Port C
- you have to disable in the SoftwareSerial.h the other intrerupts, except the one associated to PortC, that would be - PCINT1 is for Port C :
PCINT0 is for Port B
PCINT2 is for Port D
PCINT3 - it is not the case of 328P so you can leave it uncommentedso in SoftwareSerial.h comment the following for PCINT0 and 2:
#if defined(PCINT0_vect)
ISR(PCINT0_vect)
{
ReceiveOnlySoftwareSerial::handle_interrupt();
}
#endifThe other thing that you have to do now is to tell PinChangeInt.h that you use Port C for other purpose. To do this, in MyGateway.cpp, ahead of the #include "utility/PinChangeInt.h" you should include the following:
#define NO_PORTC_PINCHANGES
Save, upload, enjoy... And don't forget to modify back what you altered.
This assumes that you don't use intrerupts on pins...
-
RE: HC-SR501 motion sensor
Thank you for your answer. This was not the problem in my case. Long story short, I made a multisensor node for testing on an Arduino Uno and everything went well, the problems started when I moved to Pro Mini 5V version. I only use 3.3V for the radio, all of the other sensors of this node are 5V. The power was not the issue as I used on both Uno and Pro Mini battery power for testing. I moved the sensor back to the Uno setup (used for two weeks for testing) and still was not working. Moved the potentiometer for the Sensibility to the minimum and then I saw random good readings so arrived to the conclusion that there could be some problem with this.
After some searching I found that my Pir had 105 potentiometer both for Sensibility and Time, and in the schematics there is a 104 for Sensibility and 105 for Time, that's why the sensibility worked only the first mm of the rotation. Searched home but unfortunatly the bigest one I had was 10k and not 100k, put it for testing, pump it to the max and is working like a charm. I will try with 100k as soon as I will get some.
This is a picture with the sensor, mine had 105 on both that's why it was so hard to set. Now the multisensor is in a beautifull case, working and looking smart :). -
RE: HC-SR501 motion sensor
@Bandra said:
Does anybody who has bypassed the onboard regulator on the HC-SR501 be able to post up a photo of where you soldered?
I thought it was pretty simple and soldered my 3.3V lead to the leg on the 7133. It seems to power up (at least, so says my voltmeter), but the trigger (output) pin just goes high immediately and never changes. So on my sensors network it is just constantly triggering (even when there's no motion).
I'm doing something wrong, but not sure what it is. Any hints?
@Bandra , have you found any answers to your question? I have exactly the same problem, the output of the sensor goes straight to High, moving the potentiometers sometimes causes it to go Low but not in a stable state, goes low, you trigger it and goes high and stays this way... Maybe the sensor is on his way out... right now I don't have another one to test with.
-
RE: MQTT Broker gateway
Yes, I am talking about node ID, but what I can tell you is that until two days ago I didn't assigned node ID manual and I didn't have 3 NRF's to test with gateway + 2 nodes. Only when I got other RF's and made a couple of sensors saw that the gateway is assigning node ID 0 to all of the sensors, and all sensors worked, for example:
- temp humidity node had Node ID 0 and Child 0 and 1, and from openHAB I could use them at MYMQTT/0/0/V_HUM and MYMQTT/0/1/V_TEMP
- motion sensor at MYMQTT/0/2/V_MOTION
- and do on, other 2 sensors, all I had to take care is that all of them had distinct Child ID
Only when I got other NRF's and could make sensors and use them in paralel saw that the gateway is offering NODE ID 0 to all of my sensors, I don't know why, checked MYMQTT.h and it was set to auto assign Node ID, even in the statemant gateway.begin() assumes that the gateway should auto assign Node ID, and gw.begin(incomingMessage, AUTO, true) states it clear that relay sensor should get Node ID from the gateway.
All I did is manual assigned nodes for every one and workking like a charm. I simply like it this way, it let's more control, it's simply more "my way".
Now I want to combine some of the sensors and use a Mega2560 for this, hoping for a nice outcome.
-
RE: MQTT Broker gateway
Why is the broker offering me the same id for all of the sensors? I start the first one, broker offers me id 0, without disconnecting it I connect the second sensor and the gateway offers me same id, id=0.
I have cleared eeprom to both of them and see the requesting id first time i power them up, but still same id for both...
Edit 1:
Defined static ID and the relay works, didn't modify anything, just static ID 2 to the relay...
Edit 2:
Just tested with ID 0, 1 and 2 and I can confirm that the relay does NOT work with ID 0, it's almost a week now and I have tried everything and the answer was as simple as this: does not work with ID 0.
-
RE: MQTT Broker gateway
Will test it tomorrow morning and come back with result, what i see is exactly the same configuration, the only difference is that your's is on the 3'rd node and mine on 1'st node. Anyway, will see.
Thank you for your answer.
I am still waiting for my other NRF24L01 ( I ordered 30 pcs), they will arive this week. Maybe there is a problem running the sketch on node one, id 0. Tomorrow I will go and buy 2 of the NRF24 from a store even if they are 4 times more expensive, this not working is killing me
-
RE: MQTT Broker gateway
Callback for incomming messages does not occur so I guess that the message does not get to the relay sensor. Is there someone that is using this with MQTT Gateway and openHAB?
-
RE: MQTT Broker gateway
Downloaded from https://github.com/Damme/MQTTGateway latest MQTT Gateway (the one that responds on serial with "Ok!" not "Started!", with the modifications to MySensors.cpp) but no difference, still no sketch name and with the above settings, openHAB cannot control the relay sensor...
I used the same arduino that is working with Temp_Humidity sensor so the setup is good, the relay pins are specified in the sketch. I used the Clean_Eeprom_Config before uploading, I even used other Arduino Uno, no diffrerence, still cannot control the relay sensor from openHAB.
Anyone has a clue, a hint or something? The serial output from both the sensor and the gateway, together with openHAB configuration are two posts up.
Edit: 3 hours later and managed to make many of the sensors (Door, Distance, Dust, Gas, Humidity, Light, Motion) everyone working in conjunction with MQTT Gateway and openHAB except the Relay one...
Any help is appreciated.
Regards,
Adrian -
RE: MQTT Broker gateway
Maybe a dumb question but I don't figure things, here is my problem:
Uploaded the relay sketch to the same arduino that I used for humidity/temperature node (I don't know if this is relevant, the network has only one node, this one). Modified the pin that the relay is connected to: #define RELAY_1 4.
I am using the MQTT Gateway openHAB and cannot activate the relay...
Serial output of relay sketch is:
repeater started, id 0
send: 0-0-0-0 s=255,c=0,t=18,pt=0,l=3,st=ok:1.4
send: 0-0-0-0 s=255,c=3,t=6,pt=1,l=1,st=ok:0
send: 0-0-0-0 s=255,c=3,t=11,pt=0,l=5,st=ok:Relay
send: 0-0-0-0 s=255,c=3,t=12,pt=0,l=3,st=ok:1.0
send: 0-0-0-0 s=1,c=0,t=3,pt=0,l=3,st=ok:1.4Serial output of gateway is:
Started!
0;0;3;0;9;read: 0-0-0 s=255,c=0,t=18,pt=0,l=3:1.4
0;0;3;0;9;read: 0-0-0 s=255,c=3,t=6,pt=1,l=1:0
0;0;3;0;9;read: 0-0-0 s=255,c=3,t=11,pt=0,l=5:Relay
0;0;3;0;9;read: 0-0-0 s=255,c=3,t=12,pt=0,l=3:1.0
0;0;3;0;9;read: 0-0-0 s=1,c=0,t=3,pt=0,l=3:1.4My openHAB configuration is:
Switch node2_sw1 "sw2" (node2,all) {mqtt=">mysensor:MyMQTT/0/1/V_LIGHT:command:ON:1],>[mysensor:MyMQTT/0/1/V_LIGHT:command:OFF:0]"}
What am I doing wrong?
Thank you!
-
RE: MQTT Broker gateway
@Damme , your instructions were highly appreciated, got it working the first time. I will start creating the network now, I guess that everything will be ok. Will follow this forum for info and knowledge.
Now I will migrate openHAB to Rasberry Pi and add all the sensors one by one, there are a few.
A question though: I am using the humidity sketch and get MyMQTT/0/1/V_TEMP and MyMQTT/0/0/V_HUM reading fine but I cannot get sketch name... I don't know what I am doing wrong... Read above and I guess I have to wait for new version?
Thank you.
Adrian
Edit: Read more about Rasbery Pi capabilities regarding openHAB and I think I will use a cubietruck... Does anybody use one, cubieboard 2 or cubietruck?
-
RE: MQTT Broker gateway
Dear colleagues,
I have been using OpenHAB for a couple of days now, everything is going the right way, I've been using it with mosquitto broker for Windows, everything is solid, working well an fast. Decided to go a step further and use the MQTT Gateway presented here.
I've made a MQTT Gateway but get the "Not connected to broker" message from OpenHAB. First of all, the Gateway is an arduino uno with a w5100 shield on top in which I inserted the RF module (NRF24L01). Configured my ip in the gateway sketch (192.168.1.11) and uploaded to the arduino.
The first test was to connect with a phone (using MQTT from Playstore - used it many times before) and with a PC (using WMQTT Utility - used it many times before) and things don't look that promising, the problem beeing that client somethimes disconnects, and I cannot receive the message published in a topic (topic that I am subscribed to on the phone, pc and tablet using MQTT clients). I somethimes get the message in the serial monitor of the arduino, somethimes not.
Configured openhab.cfg to use the mqtt broker at 192.168.1.11 (before I was using mosquitto on pc 192.168.1.10 and working without problems) and everythime I change state of something in the dashboard of openhab I get this Broker Connection not Started even if after starting openhab I get serial output from arduino for some time, after this everything drops. Here is the serial output:serial_output.txt
Last two entries are: I opened the MQTT client on my phone, connected to MQTT Gateway and subscribed to topic home/# and the last one is me publishing from the phone to topic home/test the message "test message". None of the messages come back to the clients on the phone, tablet, pc, all of them subscribed to home/#
And here is the output from openhab: openhab_output.txt Ignore the samsung connect stuff, I have pull it off the network, i have managed to get it working well.
Best regards,
Adrian