Sensebender Gateway with NRF24 PA and Hardsigning and Encryption
-
Hi,
me again, today i installed the arduino ide on a other pc and it works now i could compile and upload the sketch. But when i user the Gateway5100 Sketch and put as ip Adresse 172.16.0.25 i could not ping the gateway.
Do i have to config the pins that connected to the ethernet modul? A similar problem i had with my nrf24 modul when i connect it the gateway dont start. (i dont get any data on the serial port)
Thank you a lot!
Greets Eddie -
Hi,
i did it! The gateway has worked fine all the time! When i have uploaded the GatewayW5100 Sketch and connected the Eternet Module and the NRF24 Modul, then i didnt get anythin on Serial Monitor but i think its correct so, because FHEM (my Controller) shows me that the Sensebender Gateway is connected and added one new Device.Then i tried to upload the Sketch from second post, and get some errors, i had to delete this Line
#include <drivers/ATSHA204/ATSHA204.cpp>then i could compile and upload the sketch but i get three warnings:
c:/users/meddie/appdata/local/arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld.exe: warning: changing start of section .bss by 4 bytes
c:/users/meddie/appdata/local/arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld.exe: warning: changing start of section .bss by 4 bytes
c:/users/meddie/appdata/local/arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld.exe: warning: changing start of section .bss by 4 bytes
I dont know what this means, but it looks like the gateway is working. FHEM continues showing as connected!
Do you know what this warning does mean?
Thanks a lot! -
Is it correct, that if you want to enable ATSHA204A chip in gateway, you need to enable this in MyConfig.h?
//#define MY_SIGNING_ATSHA204If I do, I get a lot of compile errors, see below, if I don't enable it, it compiles fine. It is development branch (I guess...). Setting up the environment is quite the trial and error
In file included from C:\Users\aaa\Documents\Arduino\libraries\MySensors\examples\SensebenderGatewaySerial\SensebenderGatewaySerial.ino:86:0: C:\Users\aaa\Documents\Arduino\libraries\MySensors/drivers/ATSHA204/ATSHA204.cpp:6:16: error: redefinition of 'uint8_t device_pin' static uint8_t device_pin; ^ In file included from C:\Users\aaa\Documents\Arduino\libraries\MySensors/MySensors.h:166:0, from C:\Users\aaa\Documents\Arduino\libraries\MySensors\examples\SensebenderGatewaySerial\SensebenderGatewaySerial.ino:84: C:\Users\aaa\Documents\Arduino\libraries\MySensors/drivers/ATSHA204/ATSHA204.cpp:6:16: error: 'uint8_t device_pin' previously declared here static uint8_t device_pin; ^ In file included from C:\Users\aaa\Documents\Arduino\libraries\MySensors\examples\SensebenderGatewaySerial\SensebenderGatewaySerial.ino:86:0: C:\Users\aaa\Documents\Arduino\libraries\MySensors/drivers/ATSHA204/ATSHA204.cpp: In function 'void swi_set_signal_pin(uint8_t)': C:\Users\aaa\Documents\Arduino\libraries\MySensors/drivers/ATSHA204/ATSHA204.cpp:23:13: error: redefinition of 'void swi_set_signal_pin(uint8_t)' static void swi_set_signal_pin(uint8_t is_high) ^ and a lot more... -
Is it correct, that if you want to enable ATSHA204A chip in gateway, you need to enable this in MyConfig.h?
//#define MY_SIGNING_ATSHA204If I do, I get a lot of compile errors, see below, if I don't enable it, it compiles fine. It is development branch (I guess...). Setting up the environment is quite the trial and error
In file included from C:\Users\aaa\Documents\Arduino\libraries\MySensors\examples\SensebenderGatewaySerial\SensebenderGatewaySerial.ino:86:0: C:\Users\aaa\Documents\Arduino\libraries\MySensors/drivers/ATSHA204/ATSHA204.cpp:6:16: error: redefinition of 'uint8_t device_pin' static uint8_t device_pin; ^ In file included from C:\Users\aaa\Documents\Arduino\libraries\MySensors/MySensors.h:166:0, from C:\Users\aaa\Documents\Arduino\libraries\MySensors\examples\SensebenderGatewaySerial\SensebenderGatewaySerial.ino:84: C:\Users\aaa\Documents\Arduino\libraries\MySensors/drivers/ATSHA204/ATSHA204.cpp:6:16: error: 'uint8_t device_pin' previously declared here static uint8_t device_pin; ^ In file included from C:\Users\aaa\Documents\Arduino\libraries\MySensors\examples\SensebenderGatewaySerial\SensebenderGatewaySerial.ino:86:0: C:\Users\aaa\Documents\Arduino\libraries\MySensors/drivers/ATSHA204/ATSHA204.cpp: In function 'void swi_set_signal_pin(uint8_t)': C:\Users\aaa\Documents\Arduino\libraries\MySensors/drivers/ATSHA204/ATSHA204.cpp:23:13: error: redefinition of 'void swi_set_signal_pin(uint8_t)' static void swi_set_signal_pin(uint8_t is_high) ^ and a lot more...@Magnus-Pernemark normally, you don't change MyConfig.h, you just use it as reference. And then you set your defines in your sketch prior to include mysensors.h.
I think there was a problem in the official release that the SenseBender gw sketch included some files for self testing that is not really needed (or more correctly, it included them without considering the atsha flag), so you can probably strip them from the sketch or conditionally include them. I believe it was fixed on beta. But perhaps it is still in there.
-
@Magnus-Pernemark normally, you don't change MyConfig.h, you just use it as reference. And then you set your defines in your sketch prior to include mysensors.h.
I think there was a problem in the official release that the SenseBender gw sketch included some files for self testing that is not really needed (or more correctly, it included them without considering the atsha flag), so you can probably strip them from the sketch or conditionally include them. I believe it was fixed on beta. But perhaps it is still in there.
@Anticimex Ah, I was under the impression that the SenseBender Gateway, came with default serial sketch without signing and you had to enable signing by your self if you want it. And some how in MyConfig.h (not MySensors.h) this sounded like something that needs to be changed (comment said so).
/** * @def MY_SIGNING_ATSHA204 * @brief Enables HW backed signing functionality in library. * * For any signing related functionality to be included, this define or @ref MY_SIGNING_SOFT has to * be enabled. * //#define MY_SIGNING_ATSHA204So after configuring the ATSHA chip and uploading the serialgateway to the GW, without altering any code, it will start using the ATSHA chip and reject those without?
Is it the same with Sensebender Micro? If it has a ATSHA chip it will use it, if it doesn't it will not?
I run the development branch code, 2.2.2-beta
-
@Anticimex Ah, I was under the impression that the SenseBender Gateway, came with default serial sketch without signing and you had to enable signing by your self if you want it. And some how in MyConfig.h (not MySensors.h) this sounded like something that needs to be changed (comment said so).
/** * @def MY_SIGNING_ATSHA204 * @brief Enables HW backed signing functionality in library. * * For any signing related functionality to be included, this define or @ref MY_SIGNING_SOFT has to * be enabled. * //#define MY_SIGNING_ATSHA204So after configuring the ATSHA chip and uploading the serialgateway to the GW, without altering any code, it will start using the ATSHA chip and reject those without?
Is it the same with Sensebender Micro? If it has a ATSHA chip it will use it, if it doesn't it will not?
I run the development branch code, 2.2.2-beta
@Magnus-Pernemark no, it is not enabled by default. But the SenseBender gw sketch also include self test logic used in the factory that test atsha204a communication. But this code is always included, so if you do enable the signing using atsha204a, it includes some code twice. So the sketch would only include the atsha stuff if the define isn't set.
-
@Magnus-Pernemark no, it is not enabled by default. But the SenseBender gw sketch also include self test logic used in the factory that test atsha204a communication. But this code is always included, so if you do enable the signing using atsha204a, it includes some code twice. So the sketch would only include the atsha stuff if the define isn't set.
@Anticimex I'm sorry, my vacation brain just cannot comprehend all these terms (I don't think it would even if I wasn't on vecaction :) My four hour experience with c/c++ surely has its limits).
Is it safe to say, the GW sketch does not use the ATSHA chip, and the sketch needs some modification for it to start using it?
In the mean-time, I'll try it out with the default sketch. It looks like the GW and the bender are talking to each other
-
@Anticimex I'm sorry, my vacation brain just cannot comprehend all these terms (I don't think it would even if I wasn't on vecaction :) My four hour experience with c/c++ surely has its limits).
Is it safe to say, the GW sketch does not use the ATSHA chip, and the sketch needs some modification for it to start using it?
In the mean-time, I'll try it out with the default sketch. It looks like the GW and the bender are talking to each other
@Magnus-Pernemark no, I am saying that the sketch use the atsha by default for self testing. It is not using it by default for signing. And the problem is that if you want to use it for signing it has already included some code for self testing that it shouldn't in that case. If you are not able to code c i suggest hanging on some time for someone to fix the problem. I can't do it at the moment since I am on the road. Ping @tbowmo
-
@Magnus-Pernemark
You need to enable signing with
#define MY_SIGNING_ATSHA204This will make the sketch break though, as it includes the atsha204 driver already (and the library wants to include it as well)
To remove the error comment out the following line (it's line 86 in the original source)
#include <drivers/ATSHA204/ATSHA204.cpp>(Reference to the line in github :
https://github.com/mysensors/MySensors/blob/master/examples/SensebenderGatewaySerial/SensebenderGatewaySerial.ino#L86)As an alternative, you can load the standard GatewaySerial sketch.. The only difference to the SensebenderGatewaySerial, is that the later includes test routines used in the factory.
@Anticimex I don't think that I made a PR for conditionally include the atsha driver, as the error still persists in dev branch..
-
@Magnus-Pernemark
You need to enable signing with
#define MY_SIGNING_ATSHA204This will make the sketch break though, as it includes the atsha204 driver already (and the library wants to include it as well)
To remove the error comment out the following line (it's line 86 in the original source)
#include <drivers/ATSHA204/ATSHA204.cpp>(Reference to the line in github :
https://github.com/mysensors/MySensors/blob/master/examples/SensebenderGatewaySerial/SensebenderGatewaySerial.ino#L86)As an alternative, you can load the standard GatewaySerial sketch.. The only difference to the SensebenderGatewaySerial, is that the later includes test routines used in the factory.
@Anticimex I don't think that I made a PR for conditionally include the atsha driver, as the error still persists in dev branch..
-
@tbowmo no, but I remember that another user had the same issue and agreed to file a pr but perhaps he never got around to it. Should just be a matter of adding a ifndef though.