Building an Ethernet Gateway on an Arduino Mega
-
Did you try resetting the board after power on? I guess there are some boards that have issues and need a reset after power on before anything works. See the links in this post: http://forum.mysensors.org/topic/1021/security-introducing-signing-support-to-mysensors/157. The links in that post have a relatively easy fix to implement if it turns out that is the problem.
-
I have a similar issue with Adafruit CC3000 shield and a Mega.
After much fidling around I finally got it to work.The Adafruit shiled is the same size of an Uno but when connected to a Mega it doesn't get the SCK, MOSI and MISO from the 13,11,12 pins, it gets them from the central connector ICSP as showed on the picture on this thread.
So first step was to connect the wireless module to the ICSP.
The second issue is the CSN and CE pins, these can't be connected to 10 and 9 since they are used by the shield. I've used 35 and 34.
Adjust your code like this:
#define INCLUSION_MODE_TIME 1 // Number of minutes inclusion mode is enabled
#define INCLUSION_MODE_PIN 32 // Digital pin used for inclusion mode button
#define CE_PIN 35
#define CS_PIN 34
MyGateway gw(CE_PIN, CS_PIN, INCLUSION_MODE_TIME, INCLUSION_MODE_PIN, 6, 5, 4);Even with this, some times I still get a check wires message, others just a bunch of errors about the version.
This erratic behaviour led me to think about noise on the wireless receiver, so in goes a 10uF.
Its stable now.
On a side note I also changed the CE and CS pin assignments on the sensors...
#define DIGITAL_INPUT_SENSOR 4 // The digital input you attached your motion sensor. (Only 2 and 3 generates interrupt!)
#define INTERRUPT DIGITAL_INPUT_SENSOR-2 // Usually the interrupt = pin -2 (on uno/nano anyway)
#define CHILD_ID 1 // Id of the sensor child#define CE_PIN 9
#define CS_PIN 53MySensor gw(CE_PIN,CS_PIN);
// Initialize motion message
MyMessage msg(CHILD_ID, V_TRIPPED);Cheers
@barduino said:
I have a similar issue with Adafruit CC3000 shield and a Mega.
After much fidling around I finally got it to work.The Adafruit shiled is the same size of an Uno but when connected to a Mega it doesn't get the SCK, MOSI and MISO from the 13,11,12 pins, it gets them from the central connector ICSP as showed on the picture on this thread.
So first step was to connect the wireless module to the ICSP.
The second issue is the CSN and CE pins, these can't be connected to 10 and 9 since they are used by the shield. I've used 35 and 34.
Adjust your code like this:
#define INCLUSION_MODE_TIME 1 // Number of minutes inclusion mode is enabled
#define INCLUSION_MODE_PIN 32 // Digital pin used for inclusion mode button
#define CE_PIN 35
#define CS_PIN 34
MyGateway gw(CE_PIN, CS_PIN, INCLUSION_MODE_TIME, INCLUSION_MODE_PIN, 6, 5, 4);Even with this, some times I still get a check wires message, others just a bunch of errors about the version.
This erratic behaviour led me to think about noise on the wireless receiver, so in goes a 10uF.
Its stable now.
On a side note I also changed the CE and CS pin assignments on the sensors...
#define DIGITAL_INPUT_SENSOR 4 // The digital input you attached your motion sensor. (Only 2 and 3 generates interrupt!)
#define INTERRUPT DIGITAL_INPUT_SENSOR-2 // Usually the interrupt = pin -2 (on uno/nano anyway)
#define CHILD_ID 1 // Id of the sensor child#define CE_PIN 9
#define CS_PIN 53MySensor gw(CE_PIN,CS_PIN);
// Initialize motion message
MyMessage msg(CHILD_ID, V_TRIPPED);Cheers
Hi, can you please share your Gateway code. I also having problem with a CC3000 and Arduino Mega. UNO was too small :)
Thanks
-
@barduino said:
I have a similar issue with Adafruit CC3000 shield and a Mega.
After much fidling around I finally got it to work.The Adafruit shiled is the same size of an Uno but when connected to a Mega it doesn't get the SCK, MOSI and MISO from the 13,11,12 pins, it gets them from the central connector ICSP as showed on the picture on this thread.
So first step was to connect the wireless module to the ICSP.
The second issue is the CSN and CE pins, these can't be connected to 10 and 9 since they are used by the shield. I've used 35 and 34.
Adjust your code like this:
#define INCLUSION_MODE_TIME 1 // Number of minutes inclusion mode is enabled
#define INCLUSION_MODE_PIN 32 // Digital pin used for inclusion mode button
#define CE_PIN 35
#define CS_PIN 34
MyGateway gw(CE_PIN, CS_PIN, INCLUSION_MODE_TIME, INCLUSION_MODE_PIN, 6, 5, 4);Even with this, some times I still get a check wires message, others just a bunch of errors about the version.
This erratic behaviour led me to think about noise on the wireless receiver, so in goes a 10uF.
Its stable now.
On a side note I also changed the CE and CS pin assignments on the sensors...
#define DIGITAL_INPUT_SENSOR 4 // The digital input you attached your motion sensor. (Only 2 and 3 generates interrupt!)
#define INTERRUPT DIGITAL_INPUT_SENSOR-2 // Usually the interrupt = pin -2 (on uno/nano anyway)
#define CHILD_ID 1 // Id of the sensor child#define CE_PIN 9
#define CS_PIN 53MySensor gw(CE_PIN,CS_PIN);
// Initialize motion message
MyMessage msg(CHILD_ID, V_TRIPPED);Cheers
Hi, can you please share your Gateway code. I also having problem with a CC3000 and Arduino Mega. UNO was too small :)
Thanks
I'm sorry @flopp
It did not work on the end, my shield just stopped working even with an example sketch, so I never completed the project.
What flavor of CC3000 do you have, the shield with the SD card or the small board with just the wifi module?
Cheers
-
I'm sorry @flopp
It did not work on the end, my shield just stopped working even with an example sketch, so I never completed the project.
What flavor of CC3000 do you have, the shield with the SD card or the small board with just the wifi module?
Cheers
-
Here the solution to run Arduino Mega and the shield W5100.
Into the file MyConfig.h, after the line:
#include <stdint.h>:you must add the following lines:
#if ARDUINO < 100 #include <WProgram.h> #else #include <Arduino.h> #endifThen replace the lines:
const uint8_t SOFT_SPI_MISO_PIN = 16; const uint8_t SOFT_SPI_MOSI_PIN = 15; const uint8_t SOFT_SPI_SCK_PIN = 14;with these:
const uint8_t SOFT_SPI_MISO_PIN = A2; const uint8_t SOFT_SPI_MOSI_PIN = A1; const uint8_t SOFT_SPI_SCK_PIN = A0;Finally enable define SOFTSPI removing the comment (//)
Compile and load the software and you're done! :grin:
-
Here the solution to run Arduino Mega and the shield W5100.
Into the file MyConfig.h, after the line:
#include <stdint.h>:you must add the following lines:
#if ARDUINO < 100 #include <WProgram.h> #else #include <Arduino.h> #endifThen replace the lines:
const uint8_t SOFT_SPI_MISO_PIN = 16; const uint8_t SOFT_SPI_MOSI_PIN = 15; const uint8_t SOFT_SPI_SCK_PIN = 14;with these:
const uint8_t SOFT_SPI_MISO_PIN = A2; const uint8_t SOFT_SPI_MOSI_PIN = A1; const uint8_t SOFT_SPI_SCK_PIN = A0;Finally enable define SOFTSPI removing the comment (//)
Compile and load the software and you're done! :grin:
@spugna85
Hello, I'm putting the code as you indicated, and connecting the nRF24L01 pins:
6 CSN
5 CE
Pin 50, 51, 52and message: 0;0;3;0;9;radio init fail
I link capacitor in power, I have done everything. And now????
:anguished: