We want to call the POSK function payload into function payload and insert it into SQL.
the yellow Highlighted number needs to combine with the second payload msg into the POSK column.
That's great! I am always on the lookout for people interested in testing and using the signing framework. There are really great things in the pipe for the next (1.6.0 I believe) release.
OK it's working. Main fix I think is I used the new 2.1.1 library and all comms to the RFM69 radio seems to be fixed.
Current code:
DESCRIPTION
Simple binary switch example
Connect button or door/window reed switch between
digitial I/O pin 3 (BUTTON_PIN below) and GND.
http://www.mysensors.org/build/binary
*/
// Enable debug prints to serial monitor
#define MY_DEBUG
// Enable and select radio type attached
// #define MY_RADIO_NRF24
#define MY_RADIO_RFM69
#define MY_RFM69_FREQUENCY RF69_433MHZ
#define MY_IS_RFM69HW
#if F_CPU == 8000000L
#define MY_BAUD_RATE 38400
#endif
#include <SPI.h>
#include <MySensors.h>
#define CHILD_ID 3
#define BUTTON_PIN 3 // Arduino Digital I/O pin for button/reed switch
int oldValue=-1;
// Change to V_LIGHT if you use S_LIGHT in presentation below
MyMessage msg(CHILD_ID,V_TRIPPED);
void setup()
{
// Setup the button
pinMode(BUTTON_PIN,INPUT);
// Activate internal pull-up
digitalWrite(BUTTON_PIN,HIGH);
}
void presentation() {
// Register binary input sensor to gw (they will be created as child devices)
sendSketchInfo("Binary Sensor", "1.0");
// You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage.
// If S_LIGHT is used, remember to update variable type you send in. See "msg" above.
present(CHILD_ID, S_DOOR);
// Send the sketch version information to the gateway and Controller
}
// Check if digital input has changed and send in new value
void loop()
{
int value = digitalRead(BUTTON_PIN);
#ifdef MY_DEBUG
Serial.println("Sensor Value");
Serial.println(value);
#endif
send(msg.set(value==HIGH ? 1 : 0));
sleep(BUTTON_PIN-2, CHANGE, 0);
}
Thanks,
Martin
@tekka said:
@Daemon-D Can you explain how you solved the issue - I'm sure other user could also profit if they face a similar problem. Thanks.
The problem was solved by moving to the top of the sketch exactly like the to test the sketch before #include
// Enable debug prints to serial monitor
#define MY_DEBUG
// Enable and select radio type attached
#define MY_RADIO_NRF24
//#define MY_RADIO_RFM69
// Enabled repeater feature for this node
#define MY_REPEATER_FEATURE
#include <SPI.h>
#include <MySensors.h>
Placing the receive function in my Gateway sketch worked. Thanks. For some reason I thought that function would only work for sensor nodes to watch for messages sent from the Gateway.