Teensy 3.2 and RFM69HW not working
-
HI,
I have a daft problem.
I have 20 nodes around, using Pro Mini / Nano / Uno and Mega, all with RFM69 tranceivers.
I wish to rebuild one of the Mega nodes, using a Teensy 3.2, mainly for the physical size, needing as I do more program storage for this node ( Central heating thermostat, with touchscreen).
Try as I might, I am failing at the first hurdle.
I thought I would just upload a simple sketch, and test that the communication is all ok, and build from there.
The node isn't seeing the gateway / controller, and the gateway is definitely not receiving anything from this new node.To prove the radio module, I wired it to a pro Mini, and uploaded the same sketch, which was then recognised, and added to the controller.
the GW log for the ProMini sucessful presenting is below
43;255;0;0;17;2.2.0 43;255;3;0;6;0 43;255;3;0;6;M 43;255;3;0;11;test Node 43;255;3;0;12;1.0.0 43;5;0;0;33;Motion RX RSSI 43;4;0;0;1;Prescence 43;6;0;0;30;Motion Battery V 43;4;1;0;16;0I have reconnected the Teensy to the same hardware, but it still fails, in desperation, I have changed pins for the IRQ and the CS pins, and defined them in the sketch, still no joy. I clearly am doing something basic wrong, but I am going round is a very small circle.
first bit of the failing Log from the teensy300 MCO:BGN:INIT NODE,CP=RRNNT---,VER=2.2.0 300 TSM:INIT 300 TSF:WUR:MS=0 301 TSM:INIT:TSP OK 301 TSM:INIT:STATID=43 301 TSF:SID:OK,ID=43 301 TSM:FPAR 1502 TSF:MSG:SEND,43-43-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 3503 !TSM:FPAR:NO REPLY 3503 TSM:FPAR 4703 TSF:MSG:SEND,43-43-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 6704 !TSM:FPAR:NO REPLY 6704 TSM:FPAR 7904 TSF:MSG:SEND,43-43-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 9905 !TSM:FPAR:NO REPLY 9905 TSM:FPAR 11105 TSF:MSG:SEND,43-43-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 13106 !TSM:FPAR:FAIL 13106 TSM:FAIL:CNT=1 13106 TSM:FAIL:DIS 13106 TSF:TDI:TSL 23107 TSM:FAIL:RE-INIT 23107 TSM:INITConnections are:
Teensy > RFM69HW
DIO 2 (pin 4) > DIO 0
DIO 10 CS > NSS
DIO 11 DOUT > MOSI
DIO 12 DIN > MISO
DIO 13 SCK > SCK0V and 3.3V Connected 3.311v actual measured on the pads of the RFM69
the sketch is below.
Please point out my stupid mistake.
Many thanks
Nigel
// Enable debug prints #define MY_DEBUG #define MY_DEBUG_VERBOSE_RFM69 //#define MY_DEBUG_VERBOSE_SIGNING //#define MY_SIGNING_SOFT //#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7 //#define MY_SIGNING_REQUEST_SIGNATURES #define MY_SPLASH_SCREEN_DISABLED //#define MY_DISABLE_RAM_ROUTING_TABLE_FEATURE //#define MY_TRANSPORT_WAIT_READY_MS 5000 // Enable and select radio type attached //#define MY_REPEATER_FEATURE #define MY_RADIO_RFM69 #define MY_RFM69_FREQUENCY RFM69_433MHZ // Set your frequency here #define MY_RFM69_MAX_POWER_LEVEL_DBM (13) // max. TX power 10dBm = 10mW #define MY_RFM69_TX_POWER_DBM (13) #define MY_IS_RFM69HW // Omit if your RFM is not "H" //#define MY_RFM69_IRQ_PIN 2 //#define MY_RFM69_IRQ_NUM digitalPinToInterrupt(MY_RFM69_IRQ_PIN) //#define MY_RFM69_CS_PIN 10 // NSS. Use MY_RF69_SPI_CS for older versions (before 2.2.0) //#define MY_RFM69_ENABLE_ENCRYPTION //#define MY_RFM69_NETWORKID 100 // Default is 100 in lib. Uncomment it and set your preferred network id if needed #define MY_NODE_ID 43 //#include <MyConfig.h> //#include <Filter.h> #include <MySensors.h> //#include <TimeLib.h> //#include <Bounce2.h> //#include <avr/wdt.h> //#include <Vcc.h> #define VCC_MIN 3.0 #define VCC_MAX 4.25 //Vcc vcc; int rawbatteryLevel = 0; int prevbatterylevel=0; int scaledbatterylevel = 0; uint8_t batP = 100; float batV = 3.250; int oldBatteryPcnt = 0; const float BatVccMin = 3000; // Minimum expected Battery Vcc level, in Volts. const float BatVccMax = 4250; // Maximum expected BatteryVcc level, in Volts. const int MaxBattCount = 1023; const float BatVccCorrection = 4.15 / 4.18; // Measured Battery Vcc by multimeter divided by reported Vcc #define CHILD_ID_PRESENCE 4 #define CHILD_ID_RX_RSSI 5 #define CHILD_ID_BATVCC 6 int BATTERY_SENSE_PIN = A0; // select the input pin for the battery sense point const int PresenceDetect = 3; const long interval = 20000; unsigned long previousMillis,previousrelayMillis,previouprescence= 0; unsigned long debouncetime =0; bool myprescenceDetected = 0; bool Relaystate = 0; bool uplinkAvailable = true; bool requestState; bool firstStart = true; unsigned long MYsleepTime = 3600000;//SLEEP_SEC*1000 * SLEEP_MINS * 60 ; //period_t is an enum type defined in the LowPower library (LowPower.h) int sleepcnt =0; volatile long currenttime = 0; volatile long temptime = 0; //long lightLevel = 0; // Initialize message MyMessage msgPrescenceDetect(CHILD_ID_PRESENCE, V_TRIPPED); MyMessage msgRxRSSI(CHILD_ID_RX_RSSI, V_LEVEL); MyMessage msgVcc(CHILD_ID_BATVCC, V_VOLTAGE); void setup() { // put your setup code here, to run once: //pinMode (MY_RFM69_IRQ_PIN, INPUT_PULLUP); // pinMode(PresenceDetect, INPUT); // interruptPin // pinMode(2, INPUT_PULLUP); // interruptPin2 // EIFR = (1<<INTF0) | (1<<INTF1);// prevent initial trigger, clear interrupt // wait(100); // EIFR = (1<<INTF0) | (1<<INTF1); // attachInterrupt(digitalPinToInterrupt(PresenceDetect), prescenceDetected, RISING); //wdt_disable(); // Might be redundant as the bootloader should have done this already analogReference(INTERNAL); }//end setup void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("test Node", "1.0.0"); // Register all sensors to gw (they will be created as child devices) // present(CHILD_ID_LIGHTLEVEL, S_LIGHT_LEVEL,"LIGHT_LEVEL",true); // wait(250); present(CHILD_ID_RX_RSSI, S_SOUND, "Motion RX RSSI",true); wait(1000); present(CHILD_ID_PRESENCE, S_MOTION, "Prescence", true); wait(250); present(CHILD_ID_BATVCC, S_MULTIMETER, "Motion Battery V"); }//end presentation void loop() { // put your main code here, to run repeatedly: // Read digital motion value wait(50);// wait a bit, then read in level, avoid spurious noise as PIR holds high state for 27sec bool Motion = digitalRead(PresenceDetect) == HIGH; Serial.print("Motion "); Serial.println(Motion); send(msgPrescenceDetect.set(Motion?"1":"0")); // Send tripped value to gw // get the battery Voltage if(Motion == 0){ wait(5); rawbatteryLevel = analogRead(BATTERY_SENSE_PIN);// if(prevbatterylevel != rawbatteryLevel){ wait(5); long tempV=0; for(int i=1;i<=50;i++){ wait(5); rawbatteryLevel = analogRead(BATTERY_SENSE_PIN);// tempV=tempV + rawbatteryLevel; } rawbatteryLevel = tempV/50; prevbatterylevel = rawbatteryLevel; float scaledbatterylevel = map(rawbatteryLevel,0,MaxBattCount,0,BatVccMax );// changed it to milivolts float batV = scaledbatterylevel /(1000); // Battery voltage uint8_t batP = (((scaledbatterylevel - BatVccMin)*100)/(BatVccMax-BatVccMin)); //((input - min) * 100) / (max - min) #ifdef MY_DEBUG Serial.print("RAWbatcount :"); Serial.println(rawbatteryLevel); Serial.print("batV :"); Serial.println(batV); Serial.print("batP :"); Serial.println(batP); #endif wait(100); // float volts = vcc.Read_Volts(); send(msgVcc.set(batV,2),false); if (oldBatteryPcnt != batP) { sendBatteryLevel(batP); oldBatteryPcnt = batP; } RX_SEND(); } } Serial.println("Sleep 10000"); sleep(10000); Serial.println("Sleep infinit"); // EIFR = 1;// clear interrupts // EIFR = 2; // EIFR = (1<<INTF0) | (1<<INTF1);// clear interrupts //sleep(digitalPinToInterrupt(PresenceDetect), CHANGE, MYsleepTime); }// end loop void receive(const MyMessage &message) { // We only expect one type of message from controller. But we better check anyway. if (message.isAck()) { #ifdef MY_DEBUG Serial.println("+Ack FMGW"); #endif } #ifdef MY_DEBUG Serial.print("*InMsgty :"); Serial.print(message.type); Serial.print(" MsgComd:"); Serial.print(message.getCommand()); Serial.print(" childID:"); Serial.print(message.sensor); Serial.print(" Switch:"); Serial.println(message.getFloat()); #endif if (message.type == V_STATUS || S_HEATER || V_LIGHT || V_HVAC_SETPOINT_HEAT || V_TEMP || S_HVAC) { if (message.getCommand() == 2){// THIS PROCESSES THE CONTROLLERS EXPECTED STATE OF THE OUTPUT // put code here to be executed when the message is from a request #ifdef MY_DEBUG Serial.print("REQ_Msg :"); Serial.print(message.type); Serial.print(" MsgCmd:"); Serial.print(message.getCommand()); Serial.print(" childID:"); Serial.print(message.sensor); Serial.print(" Switch:"); Serial.println(message.getBool()); #endif switch (message.sensor) {// the child ID case 1: break; case 6: break; } // end switch }// end msg=2 if (message.getCommand() == 1){// THIS PROCESSES DIRECTED COMMANDS #ifdef MY_DEBUG Serial.print("*InMsgty :"); Serial.print(message.type); Serial.print(" MsgComd:"); Serial.print(message.getCommand()); Serial.print(" childID:"); Serial.print(message.sensor); Serial.print(" Switch:"); Serial.println(message.getBool()); #endif switch (message.sensor) {// the child ID case 1: break; case 3: break; case 6: break; } // end switch }// end if msg = 1 }// end msg type function }// end void loop void prescenceDetected() { // action when interrupt button doesnt really do anyhing as edge triggered currenttime = millis(); if ((currenttime - debouncetime) > 2000) { myprescenceDetected = 1; } debouncetime = currenttime; } void RX_SEND() { send(msgRxRSSI.set(transportGetSignalReport(SR_RX_RSSI))); } void sendBatteryReport() { // float p = vcc.Read_Perc(VCC_MIN, VCC_MAX, true); // int batP = static_cast<int>(p); #ifdef MY_DEBUG Serial.print("Battery is: "); Serial.println("99"); #endif sendBatteryLevel(99); } /* // This is called when a new time value was received void receiveTime(unsigned long controllerTime) { // Ok, set incoming time #ifdef MY_DEBUG Serial.print("Time value received: "); #endif if (controllerTime > 1525129200){ setTime(controllerTime); #ifdef MY_DEBUG Serial.print("Time value valid: "); Serial.println(controllerTime); #endif // RTC.set(controllerTime); // this sets the RTC to the time from controller - which we do want periodically timeReceived = true; #ifdef MY_DEBUG Serial.print(hour()); Serial.print(" "); Serial.print(minute()); Serial.print(" "); Serial.print(second()); Serial.print(" "); Serial.print(day()); Serial.print(" "); Serial.print(month()); Serial.print(" "); Serial.print(year()); Serial.println(); #endif } } */ -
What does the debug show in your serial monitor?
-
Is the RFM module actually a HW model? And which RFM driver (old/new) is the gateway using?
-
Is the RFM module actually a HW model? And which RFM driver (old/new) is the gateway using?
@electrik
Hi sorry, the GW and all nodes use the old driver. I did try the new one, some time ago, and it plain didn't work for me. I am sticking with 2.2.0 for the moment, when I upgraded to 2.3.0, everything broke, so I am sticking with 2.2.0 untill a major revision. -
Hi,
I have uncommented the defines for the IRX and the CS pins, they are however the defaults.
I have tried other pins for the IRQ (9)
A log is below.300 MCO:BGN:INIT NODE,CP=RRNNT---,VER=2.2.0 300 TSM:INIT 300 TSF:WUR:MS=0 301 TSM:INIT:TSP OK 301 TSM:INIT:STATID=43 301 TSF:SID:OK,ID=43 301 TSM:FPAR 7502 TSF:MSG:SEND,43-43-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 9503 !TSM:FPAR:NO REPLY 9503 TSM:FPAR 16703 TSF:MSG:SEND,43-43-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 18704 !TSM:FPAR:NO REPLY 18704 TSM:FPAR 25904 TSF:MSG:SEND,43-43-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 27905 !TSM:FPAR:NO REPLY 27905 TSM:FPAR 35105 TSF:MSG:SEND,43-43-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 37106 !TSM:FPAR:FAIL 37106 TSM:FAIL:CNT=1 37106 TSM:FAIL:DIS 37106 TSF:TDI:TSL 47107 TSM:FAIL:RE-INIT 47107 TSM:INIT 47157 !TSM:INIT:TSP FAIL 47157 TSM:FAIL:CNT=2 47157 TSM:FAIL:DIS 47157 TSF:TDI:TSL 57158 TSM:FAIL:RE-INIT 57158 TSM:INIT 57208 !TSM:INIT:TSP FAIL 57208 TSM:FAIL:CNT=3 57208 TSM:FAIL:DIS 57208 TSF:TDI:TSL 67209 TSM:FAIL:RE-INIT 67209 TSM:INIT 67259 !TSM:INIT:TSP FAIL 67259 TSM:FAIL:CNT=4 67259 TSM:FAIL:DIS 67259 TSF:TDI:TSL 77260 TSM:FAIL:RE-INIT 77260 TSM:INIT 77310 !TSM:INIT:TSP FAIL 77310 TSM:FAIL:CNT=5 77310 TSM:FAIL:DIS 77310 TSF:TDI:TSL 87311 TSM:FAIL:RE-INIT 87311 TSM:INIT 87361 !TSM:INIT:TSP FAIL 87361 TSM:FAIL:CNT=6 87361 TSM:FAIL:DIS 87361 TSF:TDI:TSL 97362 TSM:FAIL:RE-INIT 97362 TSM:INIT 97412 !TSM:INIT:TSP FAIL 97412 TSM:FAIL:CNT=7 97412 TSM:FAIL:DIS 97412 TSF:TDI:TSLThe sketch for this log is below
// Enable debug prints #define MY_DEBUG #define MY_DEBUG_VERBOSE_RFM69 //#define MY_DEBUG_VERBOSE_SIGNING //#define MY_SIGNING_SOFT //#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7 //#define MY_SIGNING_REQUEST_SIGNATURES #define MY_SPLASH_SCREEN_DISABLED //#define MY_DISABLE_RAM_ROUTING_TABLE_FEATURE //#define MY_TRANSPORT_WAIT_READY_MS 5000 // Enable and select radio type attached //#define MY_REPEATER_FEATURE #define MY_RADIO_RFM69 #define MY_RFM69_FREQUENCY RFM69_433MHZ // Set your frequency here #define MY_RFM69_MAX_POWER_LEVEL_DBM (13) // max. TX power 10dBm = 10mW #define MY_RFM69_TX_POWER_DBM (13) #define MY_IS_RFM69HW // Omit if your RFM is not "H" #define MY_RFM69_IRQ_PIN 2 #define MY_RFM69_IRQ_NUM digitalPinToInterrupt(MY_RFM69_IRQ_PIN) #define MY_RFM69_CS_PIN 10 // NSS. Use MY_RF69_SPI_CS for older versions (before 2.2.0) //#define MY_RFM69_ENABLE_ENCRYPTION //#define MY_RFM69_NETWORKID 100 // Default is 100 in lib. Uncomment it and set your preferred network id if needed #define MY_NODE_ID 43 //#include <MyConfig.h> //#include <Filter.h> #include <MySensors.h> //#include <TimeLib.h> //#include <Bounce2.h> //#include <avr/wdt.h> //#include <Vcc.h> #define VCC_MIN 3.0 #define VCC_MAX 4.25 //Vcc vcc; int rawbatteryLevel = 0; int prevbatterylevel=0; int scaledbatterylevel = 0; uint8_t batP = 100; float batV = 3.250; int oldBatteryPcnt = 0; const float BatVccMin = 3000; // Minimum expected Battery Vcc level, in Volts. const float BatVccMax = 4250; // Maximum expected BatteryVcc level, in Volts. const int MaxBattCount = 1023; const float BatVccCorrection = 4.15 / 4.18; // Measured Battery Vcc by multimeter divided by reported Vcc #define CHILD_ID_PRESENCE 4 #define CHILD_ID_RX_RSSI 5 #define CHILD_ID_BATVCC 6 int BATTERY_SENSE_PIN = A0; // select the input pin for the battery sense point const int PresenceDetect = 3; const long interval = 20000; unsigned long previousMillis,previousrelayMillis,previouprescence= 0; unsigned long debouncetime =0; bool myprescenceDetected = 0; bool Relaystate = 0; bool uplinkAvailable = true; bool requestState; bool firstStart = true; unsigned long MYsleepTime = 3600000;//SLEEP_SEC*1000 * SLEEP_MINS * 60 ; //period_t is an enum type defined in the LowPower library (LowPower.h) int sleepcnt =0; volatile long currenttime = 0; volatile long temptime = 0; //long lightLevel = 0; // Initialize message MyMessage msgPrescenceDetect(CHILD_ID_PRESENCE, V_TRIPPED); MyMessage msgRxRSSI(CHILD_ID_RX_RSSI, V_LEVEL); MyMessage msgVcc(CHILD_ID_BATVCC, V_VOLTAGE); void setup() { // put your setup code here, to run once: //pinMode (MY_RFM69_IRQ_PIN, INPUT_PULLUP); // pinMode(PresenceDetect, INPUT); // interruptPin // pinMode(2, INPUT_PULLUP); // interruptPin2 // EIFR = (1<<INTF0) | (1<<INTF1);// prevent initial trigger, clear interrupt // wait(100); // EIFR = (1<<INTF0) | (1<<INTF1); // attachInterrupt(digitalPinToInterrupt(PresenceDetect), prescenceDetected, RISING); //wdt_disable(); // Might be redundant as the bootloader should have done this already analogReference(INTERNAL); }//end setup void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("test Node", "1.0.0"); // Register all sensors to gw (they will be created as child devices) // present(CHILD_ID_LIGHTLEVEL, S_LIGHT_LEVEL,"LIGHT_LEVEL",true); // wait(250); present(CHILD_ID_RX_RSSI, S_SOUND, "Motion RX RSSI",true); wait(1000); present(CHILD_ID_PRESENCE, S_MOTION, "Prescence", true); wait(250); present(CHILD_ID_BATVCC, S_MULTIMETER, "Motion Battery V"); }//end presentation void loop() { // put your main code here, to run repeatedly: // Read digital motion value wait(50);// wait a bit, then read in level, avoid spurious noise as PIR holds high state for 27sec bool Motion = digitalRead(PresenceDetect) == HIGH; Serial.print("Motion "); Serial.println(Motion); send(msgPrescenceDetect.set(Motion?"1":"0")); // Send tripped value to gw // get the battery Voltage if(Motion == 0){ wait(5); rawbatteryLevel = analogRead(BATTERY_SENSE_PIN);// if(prevbatterylevel != rawbatteryLevel){ wait(5); long tempV=0; for(int i=1;i<=50;i++){ wait(5); rawbatteryLevel = analogRead(BATTERY_SENSE_PIN);// tempV=tempV + rawbatteryLevel; } rawbatteryLevel = tempV/50; prevbatterylevel = rawbatteryLevel; float scaledbatterylevel = map(rawbatteryLevel,0,MaxBattCount,0,BatVccMax );// changed it to milivolts float batV = scaledbatterylevel /(1000); // Battery voltage uint8_t batP = (((scaledbatterylevel - BatVccMin)*100)/(BatVccMax-BatVccMin)); //((input - min) * 100) / (max - min) #ifdef MY_DEBUG Serial.print("RAWbatcount :"); Serial.println(rawbatteryLevel); Serial.print("batV :"); Serial.println(batV); Serial.print("batP :"); Serial.println(batP); #endif wait(100); // float volts = vcc.Read_Volts(); send(msgVcc.set(batV,2),false); if (oldBatteryPcnt != batP) { sendBatteryLevel(batP); oldBatteryPcnt = batP; } RX_SEND(); } } Serial.println("Sleep 10000"); sleep(10000); Serial.println("Sleep infinit"); // EIFR = 1;// clear interrupts // EIFR = 2; // EIFR = (1<<INTF0) | (1<<INTF1);// clear interrupts //sleep(digitalPinToInterrupt(PresenceDetect), CHANGE, MYsleepTime); }// end loop void receive(const MyMessage &message) { // We only expect one type of message from controller. But we better check anyway. if (message.isAck()) { #ifdef MY_DEBUG Serial.println("+Ack FMGW"); #endif } #ifdef MY_DEBUG Serial.print("*InMsgty :"); Serial.print(message.type); Serial.print(" MsgComd:"); Serial.print(message.getCommand()); Serial.print(" childID:"); Serial.print(message.sensor); Serial.print(" Switch:"); Serial.println(message.getFloat()); #endif if (message.type == V_STATUS || S_HEATER || V_LIGHT || V_HVAC_SETPOINT_HEAT || V_TEMP || S_HVAC) { if (message.getCommand() == 2){// THIS PROCESSES THE CONTROLLERS EXPECTED STATE OF THE OUTPUT // put code here to be executed when the message is from a request #ifdef MY_DEBUG Serial.print("REQ_Msg :"); Serial.print(message.type); Serial.print(" MsgCmd:"); Serial.print(message.getCommand()); Serial.print(" childID:"); Serial.print(message.sensor); Serial.print(" Switch:"); Serial.println(message.getBool()); #endif switch (message.sensor) {// the child ID case 1: break; case 6: break; } // end switch }// end msg=2 if (message.getCommand() == 1){// THIS PROCESSES DIRECTED COMMANDS #ifdef MY_DEBUG Serial.print("*InMsgty :"); Serial.print(message.type); Serial.print(" MsgComd:"); Serial.print(message.getCommand()); Serial.print(" childID:"); Serial.print(message.sensor); Serial.print(" Switch:"); Serial.println(message.getBool()); #endif switch (message.sensor) {// the child ID case 1: break; case 3: break; case 6: break; } // end switch }// end if msg = 1 }// end msg type function }// end void loop void prescenceDetected() { // action when interrupt button doesnt really do anyhing as edge triggered currenttime = millis(); if ((currenttime - debouncetime) > 2000) { myprescenceDetected = 1; } debouncetime = currenttime; } void RX_SEND() { send(msgRxRSSI.set(transportGetSignalReport(SR_RX_RSSI))); } void sendBatteryReport() { // float p = vcc.Read_Perc(VCC_MIN, VCC_MAX, true); // int batP = static_cast<int>(p); #ifdef MY_DEBUG Serial.print("Battery is: "); Serial.println("99"); #endif sendBatteryLevel(99); } /* // This is called when a new time value was received void receiveTime(unsigned long controllerTime) { // Ok, set incoming time #ifdef MY_DEBUG Serial.print("Time value received: "); #endif if (controllerTime > 1525129200){ setTime(controllerTime); #ifdef MY_DEBUG Serial.print("Time value valid: "); Serial.println(controllerTime); #endif // RTC.set(controllerTime); // this sets the RTC to the time from controller - which we do want periodically timeReceived = true; #ifdef MY_DEBUG Serial.print(hour()); Serial.print(" "); Serial.print(minute()); Serial.print(" "); Serial.print(second()); Serial.print(" "); Serial.print(day()); Serial.print(" "); Serial.print(month()); Serial.print(" "); Serial.print(year()); Serial.println(); #endif } } */one thing of interest is that after the point or re-init it fails.
Should the Reset be connected for this? I see that a comment is made on the Radio hardware build page, that
"* Adafruit modules need RST connected to GND, or to MY_RFM69_RST_PIN"
Ill try that in a while.
I also tried the#define TEENSYDUINO, just in case, but this failed to compile as a re- definition, so that is being set. -
Hi,
Well progress, and questions !
When I started this with the Teensy3.2, I used a RFM69CW (smaller pcb) device, and ran into the problems as detailed above.
As part of the troubleshooting, I part assembled a "EASY PCB" which I have, to enable, hopefully proving a different radio module (RFM69HW) which is my normal radio module, and attempt to "tight fit" a Pro mini to header pins on the board, to "prove" the radio. This was sucessful, as mentioned above. Using this proven radio / assembly, I removed the Pro Mini, and jumpered to the Teensy with dupont cables, which got the radio "working" in the sense that the transport succeeded, it just couldn't find the parent / gateway.
I mentioned above the possibility of connecting the reset pin, as I had the origional bare RFM69CW already to go, I soldered another wire to the reset pad, and utilised this at the radio, commenting out the #define MY_IS_RFM69HW .
and adding the #define MY_RFM69_RST_PIN 9 .I uploaded this, and it found, and presented to the GW / Controller.
BUT subsequent messages were met with "!MCO:SND:NODE NOT REG"
as in the log below300 MCO:BGN:INIT NODE,CP=RRNNT---,VER=2.2.0 300 TSM:INIT 300 TSF:WUR:MS=0 301 TSM:INIT:TSP OK 301 TSM:INIT:STATID=44 301 TSF:SID:OK,ID=44 301 TSM:FPAR 1529 TSF:MSG:SEND,44-44-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 1547 TSF:MSG:READ,0-0-44,s=255,c=3,t=8,pt=1,l=1,sg=0:0 1547 TSF:MSG:FPAR OK,ID=0,D=1 3530 TSM:FPAR:OK 3530 TSM:ID 3530 TSM:ID:OK 3530 TSM:UPL 3536 TSF:MSG:SEND,44-44-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1 3747 TSF:MSG:READ,0-0-44,s=255,c=3,t=25,pt=1,l=1,sg=0:1 3747 TSF:MSG:PONG RECV,HP=1 3747 TSM:UPL:OK 3747 TSM:READY:ID=44,PAR=0,DIS=1 4774 TSF:MSG:SEND,44-44-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100 4985 TSF:MSG:READ,0-0-44,s=255,c=3,t=15,pt=6,l=2,sg=0:0100 6218 !TSF:MSG:SEND,44-44-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=NACK:2.2.0 6234 TSF:MSG:SEND,44-44-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=1,st=OK:0 6459 TSF:MSG:READ,0-0-44,s=255,c=3,t=6,pt=0,l=1,sg=0:M 7492 TSF:MSG:SEND,44-44-0-0,s=255,c=3,t=11,pt=0,l=9,sg=0,ft=0,st=OK:test Node 7502 TSF:MSG:SEND,44-44-0-0,s=255,c=3,t=12,pt=0,l=5,sg=0,ft=0,st=OK:1.0.0 7515 TSF:MSG:SEND,44-44-0-0,s=5,c=0,t=33,pt=0,l=14,sg=0,ft=0,st=OK:Motion RX RSSI 7729 TSF:MSG:READ,0-0-44,s=5,c=0,t=33,pt=0,l=14,sg=0:Motion RX RSS 7729 TSF:MSG:ACK +Ack FMGW *InMsgty :33 MsgComd:0 childID:5 Switch:0.00 7936 TSF:MSG:READ,0-0-44,s=5,c=0,t=33,pt=0,l=14,sg=0:Motion RX RSS 7936 TSF:MSG:ACK +Ack FMGW *InMsgty :33 MsgComd:0 childID:5 Switch:0.00 8141 TSF:MSG:READ,0-0-44,s=5,c=0,t=33,pt=0,l=14,sg=0:Motion RX RSS 8141 TSF:MSG:ACK +Ack FMGW *InMsgty :33 MsgComd:0 childID:5 Switch:0.00 8344 TSF:MSG:READ,0-0-44,s=5,c=0,t=33,pt=0,l=14,sg=0:Motion RX RSS 8345 TSF:MSG:ACK +Ack FMGW *InMsgty :33 MsgComd:0 childID:5 Switch:0.00 8937 TSF:MSG:SEND,44-44-0-0,s=4,c=0,t=1,pt=0,l=9,sg=0,ft=0,st=OK:Prescence 9149 TSF:MSG:READ,0-0-44,s=4,c=0,t=1,pt=0,l=9,sg=0:Prescenc 9149 TSF:MSG:ACK +Ack FMGW *InMsgty :1 MsgComd:0 childID:4 Switch:0.00 10225 TSF:MSG:SEND,44-44-0-0,s=6,c=0,t=30,pt=0,l=16,sg=0,ft=0,st=OK:Motion Battery V 10226 MCO:REG:REQ 10234 TSF:MSG:SEND,44-44-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2 10444 TSF:MSG:READ,0-0-44,s=255,c=3,t=27,pt=1,l=1,sg=0:0 10444 MCO:PIM:NODE REG=0 10445 MCO:BGN:STP 10445 MCO:BGN:INIT OK,TSP=1 Motion 0 10495 !MCO:SND:NODE NOT REG 10647 TSF:MSG:READ,0-0-44,s=255,c=3,t=27,pt=1,l=1,sg=0:0 10647 MCO:PIM:NODE REG=0 RAWbatcount :179 batV :0.74 batP :0 10850 TSF:MSG:READ,0-0-44,s=255,c=3,t=27,pt=1,l=1,sg=0:0 10850 MCO:PIM:NODE REG=0 10857 !MCO:SND:NODE NOT REG 10857 !MCO:SND:NODE NOT REG wait 10000 11258 TSF:MSG:READ,0-0-44,s=255,c=3,t=27,pt=1,l=1,sg=0:0 11258 MCO:PIM:NODE REG=0Progress of a sort. I noticed however that in the Controller, each child presentation, including the MYSENSORS version was missing the last character. I have seen this sort of thing in entirely different situations with serial coms, baud rates mismatching slightly (due to processor speed dividing ratios), and I knew that out of the box, the teensy runs overclocked at 96Mhz, so I changed the speed of the processor, to 72Mhz, and uploaded, had the same results, Then I selected 48Mhz, and uploaded again, and Eureka, it all works.
So in summary, I have wired in the Reset Pad to (in my case) Pin 9, and slowed the Processor to 48Mhz, and all is working.
AFTER this, I have simplified the sketch, to be a incrementing count, in a txt field.
Sketch as is NOW, but AFTER it was working// Enable debug prints #define MY_DEBUG #define MY_DEBUG_VERBOSE_RFM69 //#define MY_DEBUG_VERBOSE_SIGNING //#define MY_SIGNING_SOFT //#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7 //#define MY_SIGNING_REQUEST_SIGNATURES #define MY_SPLASH_SCREEN_DISABLED //#define MY_DISABLE_RAM_ROUTING_TABLE_FEATURE //#define MY_TRANSPORT_WAIT_READY_MS 5000 // Enable and select radio type attached //#define MY_REPEATER_FEATURE #define MY_RADIO_RFM69 #define MY_RFM69_FREQUENCY RFM69_433MHZ // Set your frequency here #define MY_RFM69_MAX_POWER_LEVEL_DBM (14) // max. TX power 10dBm = 10mW #define MY_RFM69_TX_POWER_DBM (14) //#define MY_IS_RFM69HW // Omit if your RFM is not "H" #define MY_RFM69_IRQ_PIN 2 #define MY_RFM69_IRQ_NUM digitalPinToInterrupt(MY_RFM69_IRQ_PIN) #define MY_RFM69_CS_PIN 10 // NSS. Use MY_RF69_SPI_CS for older versions (before 2.2.0) #define MY_RFM69_RST_PIN 9 // try reset pin //#define MY_RFM69_ENABLE_ENCRYPTION //#define MY_RFM69_NETWORKID 100 // Default is 100 in lib. Uncomment it and set your preferred network id if needed #define MY_NODE_ID 45 //#include <MyConfig.h> #include <MySensors.h> long counter = 0; #define CHILD_ID_RX_RSSI 5 #define CHILD_ID_TEXT1 7 // Initialize message MyMessage msgRxRSSI(CHILD_ID_RX_RSSI, V_LEVEL); MyMessage msgText(CHILD_ID_TEXT1, V_TEXT); void setup() { // put your setup code here, to run once: analogReference(INTERNAL); }//end setup void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("test Node", "1.0.1"); present(CHILD_ID_RX_RSSI, S_SOUND, "Motion RX RSSI",true); wait(250); present(CHILD_ID_TEXT1, S_INFO,"UpdateTxt",false); }//end presentation void loop() { // put your main code here, to run repeatedly: counter++; send(msgText.set(counter), false); wait(10000);// wait a bit, then read in level, avoid spurious noise as PIR holds high state for 27sec RX_SEND(); wait(10000); }// end loop void RX_SEND() { send(msgRxRSSI.set(transportGetSignalReport(SR_RX_RSSI))); }Log NOW
300 MCO:BGN:INIT NODE,CP=RRNNT---,VER=2.2.0 300 TSM:INIT 300 TSF:WUR:MS=0 300 TSM:INIT:TSP OK 300 TSM:INIT:STATID=45 300 TSF:SID:OK,ID=45 300 TSM:FPAR 1520 TSF:MSG:SEND,45-45-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 1604 TSF:MSG:READ,0-0-45,s=255,c=3,t=8,pt=1,l=1,sg=0:0 1604 TSF:MSG:FPAR OK,ID=0,D=1 3521 TSM:FPAR:OK 3521 TSM:ID 3521 TSM:ID:OK 3521 TSM:UPL 3527 TSF:MSG:SEND,45-45-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1 3739 TSF:MSG:READ,0-0-45,s=255,c=3,t=25,pt=1,l=1,sg=0:1 3739 TSF:MSG:PONG RECV,HP=1 3739 TSM:UPL:OK 3739 TSM:READY:ID=45,PAR=0,DIS=1 3759 TSF:MSG:SEND,45-45-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100 3968 TSF:MSG:READ,0-0-45,s=255,c=3,t=15,pt=6,l=2,sg=0:0100 3983 TSF:MSG:SEND,45-45-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.2.0 3994 TSF:MSG:SEND,45-45-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0 4024 TSF:MSG:READ,0-0-45,s=255,c=3,t=6,pt=0,l=1,sg=0:M 4050 TSF:MSG:SEND,45-45-0-0,s=255,c=3,t=11,pt=0,l=9,sg=0,ft=0,st=OK:test Node 4066 TSF:MSG:SEND,45-45-0-0,s=255,c=3,t=12,pt=0,l=5,sg=0,ft=0,st=OK:1.0.1 4081 TSF:MSG:SEND,45-45-0-0,s=5,c=0,t=33,pt=0,l=14,sg=0,ft=0,st=OK:Motion RX RSSI 4294 TSF:MSG:READ,0-0-45,s=5,c=0,t=33,pt=0,l=14,sg=0:Motion RX RSSI 4295 TSF:MSG:ACK 4338 TSF:MSG:SEND,45-45-0-0,s=7,c=0,t=36,pt=0,l=9,sg=0,ft=0,st=OK:UpdateTxt 4338 MCO:REG:REQ 4346 TSF:MSG:SEND,45-45-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2 4555 TSF:MSG:READ,0-0-45,s=255,c=3,t=27,pt=1,l=1,sg=0:1 4555 MCO:PIM:NODE REG=1 4555 MCO:BGN:STP 4555 MCO:BGN:INIT OK,TSP=1 4577 TSF:MSG:SEND,45-45-0-0,s=7,c=1,t=47,pt=4,l=4,sg=0,ft=0,st=OK:1 14583 TSF:MSG:SEND,45-45-0-0,s=5,c=1,t=37,pt=2,l=2,sg=0,ft=0,st=OK:0 24589 TSF:MSG:SEND,45-45-0-0,s=7,c=1,t=47,pt=4,l=4,sg=0,ft=0,st=OK:2 34595 TSF:MSG:SEND,45-45-0-0,s=5,c=1,t=37,pt=2,l=2,sg=0,ft=0,st=OK:0 44601 TSF:MSG:SEND,45-45-0-0,s=7,c=1,t=47,pt=4,l=4,sg=0,ft=0,st=OK:3 54607 TSF:MSG:SEND,45-45-0-0,s=5,c=1,t=37,pt=2,l=2,sg=0,ft=0,st=OK:0 64613 TSF:MSG:SEND,45-45-0-0,s=7,c=1,t=47,pt=4,l=4,sg=0,ft=0,st=OK:4 74619 TSF:MSG:SEND,45-45-0-0,s=5,c=1,t=37,pt=2,l=2,sg=0,ft=0,st=OK:0 84625 TSF:MSG:SEND,45-45-0-0,s=7,c=1,t=47,pt=4,l=4,sg=0,ft=0,st=OK:5 94631 TSF:MSG:SEND,45-45-0-0,s=5,c=1,t=37,pt=2,l=2,sg=0,ft=0,st=OK:0 106058 !TSF:MSG:SEND,45-45-0-0,s=7,c=1,t=47,pt=4,l=4,sg=0,ft=0,st=NACK:6 115278 TSF:MSG:READ,7-7-255,s=255,c=3,t=7,pt=0,l=0,sg=0: 115278 TSF:MSG:BC 115482 TSF:MSG:READ,7-7-255,s=255,c=3,t=7,pt=0,l=0,sg=0: 115482 TSF:MSG:BC 115685 TSF:MSG:READ,7-7-255,s=255,c=3,t=7,pt=0,l=0,sg=0: 115686 TSF:MSG:BC 115889 TSF:MSG:READ,7-7-255,s=255,c=3,t=7,pt=0,l=0,sg=0: 115889 TSF:MSG:BC 116673 TSF:MSG:SEND,45-45-0-0,s=5,c=1,t=37,pt=2,l=2,sg=0,ft=1,st=OK:0 118528 TSF:MSG:READ,7-7-255,s=255,c=3,t=7,pt=0,l=0,sg=0: 118528 TSF:MSG:BC 118731 TSF:MSG:READ,7-7-255,s=255,c=3,t=7,pt=0,l=0,sg=0: 118731 TSF:MSG:BC 118934 TSF:MSG:READ,7-7-255,s=255,c=3,t=7,pt=0,l=0,sg=0: 118934 TSF:MSG:BC 119138 TSF:MSG:READ,7-7-255,s=255,c=3,t=7,pt=0,l=0,sg=0: 119139 TSF:MSG:BC 119342 TSF:MSG:READ,7-7-255,s=255,c=3,t=7,pt=0,l=0,sg=0: 119342 TSF:MSG:BC 119545 TSF:MSG:READ,7-7-255,s=255,c=3,t=7,pt=0,l=0,sg=0: 119545 TSF:MSG:BC 126679 TSF:MSG:SEND,45-45-0-0,s=7,c=1,t=47,pt=4,l=4,sg=0,ft=0,st=OK:7 136690 TSF:MSG:SEND,45-45-0-0,s=5,c=1,t=37,pt=2,l=2,sg=0,ft=0,st=OK:0 147104 TSF:MSG:SEND,45-45-0-0,s=7,c=1,t=47,pt=4,l=4,sg=0,ft=0,st=OK:8 157111 TSF:MSG:SEND,45-45-0-0,s=5,c=1,t=37,pt=2,l=2,sg=0,ft=0,st=OK:0 167117 TSF:MSG:SEND,45-45-0-0,s=7,c=1,t=47,pt=4,l=4,sg=0,ft=0,st=OK:9 177123 TSF:MSG:SEND,45-45-0-0,s=5,c=1,t=37,pt=2,l=2,sg=0,ft=0,st=OK:0Has anyone had to reduce the Processor speed to make Teensy 3.2 Work previously?
Any thoughts gratefully received.