Iboard - Cheap Single board Ethernet Arduino with Radio
-
-
To close the loop on this (and to help future dwellers), a new board solved the issue. Not sure what wasn't working properly on the old board but I'm up and running again (with the same old radio, supply, etc).
Also, since I've learned a little and now understand a few of the configs better since my original iBoard build, I was able to do this WITHOUT the hardware mod.
I set the following in MyConfig.H:
const uint8_t SOFT_SPI_MISO_PIN = 6; const uint8_t SOFT_SPI_MOSI_PIN = 5; const uint8_t SOFT_SPI_SCK_PIN = 7;My failure from several months ago was not setting the CE and SS pins properly in my sketch. I also took @Dwalt 's advice and updated my inclusion and LED pins (even though I didn't use them):
#define INCLUSION_MODE_TIME 1 // Number of minutes inclusion mode is enabled #define INCLUSION_MODE_PIN 14 // Digital pin used for inclusion mode button A0 #define RADIO_CE_PIN 3 // radio chip enable #define RADIO_SPI_SS_PIN 8 // radio SPI serial select #define RADIO_ERROR_LED_PIN 15 // Error led pin A1 #define RADIO_RX_LED_PIN 16 // Receive led pin A2 #define RADIO_TX_LED_PIN 17 // the PCB, on board LED A3 -
Hello,
I have been trying to get my iBoard working correctly for a few months on and off and finally got it up and running with good range and things are working good. However I am having an issue with the gateway always being stuck in inclusion mode, I have the following sketch, I would like to retain the onboard LED's but I don't have an inclusion button or need one since I can start the inclusion process from Vera. Any guidance would be greatly appreciated.
/** * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each * repeater and gateway builds a routing tables in EEPROM which keeps track of the * network topology allowing messages to be routed to nodes. * * Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Copyright (C) 2013-2015 Sensnology AB * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * * Documentation: http://www.mysensors.org * Support Forum: http://forum.mysensors.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * ******************************* * * REVISION HISTORY * Version 1.0 - Henrik EKblad * Contribution by a-lurker and Anticimex, * Contribution by Norbert Truchsess <norbert.truchsess@t-online.de> * * * DESCRIPTION * The EthernetGateway sends data received from sensors to the ethernet link. * The gateway also accepts input on ethernet interface, which is then sent out to the radio network. * * The GW code is designed for Arduino 328p / 16MHz. ATmega168 does not have enough memory to run this program. * * * COMPILING WIZNET (W5100) ETHERNET MODULE * > Edit MyConfig.h in (libraries\MySensors\) to enable softspi (remove // before "#define SOFTSPI"). * * COMPILING ENC28J60 ETHERNET MODULE * > Use Arduino IDE 1.5.7 (or later) * > Disable DEBUG in Sensor.h before compiling this sketch. Othervise the sketch will probably not fit in program space when downloading. * > Remove Ethernet.h include below and include UIPEthernet.h * > Remove DigitalIO include * Note that I had to disable UDP and DHCP support in uipethernet-conf.h to reduce space. (which means you have to choose a static IP for that module) * * VERA CONFIGURATION: * Enter "ip-number:port" in the ip-field of the Arduino GW device. This will temporarily override any serial configuration for the Vera plugin. * E.g. If you want to use the defualt values in this sketch enter: 192.168.178.66:5003 * * LED purposes: * - To use the feature, uncomment WITH_LEDS_BLINKING in MyConfig.h * - RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly * - ERR (red) - fast blink on error during transmission error or recieve crc error * * See http://www.mysensors.org/build/ethernet_gateway for wiring instructions. * */ #define NO_PORTB_PINCHANGES #include <DigitalIO.h> // This include can be removed when using UIPEthernet module #include <SPI.h> #include <MySigningNone.h> #include <MyTransportRFM69.h> #include <MyTransportNRF24.h> #include <MyHwATMega328.h> #include <MySigningAtsha204Soft.h> #include <MySigningAtsha204.h> #include <MyParserSerial.h> #include <MySensor.h> #include <stdarg.h> #include <PinChangeInt.h> #include "GatewayUtil.h" // Use this if you have attached a Ethernet ENC28J60 shields // #include <UIPEthernet.h> // Use this for WizNET W5100 module and Arduino Ethernet Shield #include <Ethernet.h> #define INCLUSION_MODE_TIME 1 // Number of minutes inclusion mode is enabled #define INCLUSION_MODE_PIN 14 // Digital pin used for inclusion mode button #define RADIO_CE_PIN 3 // radio chip enable #define RADIO_SPI_SS_PIN 8 // radio SPI serial select #define RADIO_ERROR_LED_PIN 7 // Error led pin #define RADIO_RX_LED_PIN 6 // Receive led pin #define RADIO_TX_LED_PIN 9 // the PCB, on board LED // NRFRF24L01 radio driver (set low transmit power by default) MyTransportNRF24 transport(RADIO_CE_PIN, RADIO_SPI_SS_PIN, RF24_PA_LEVEL_GW); //MyTransportRFM69 transport; // Message signing driver (signer needed if MY_SIGNING_FEATURE is turned on in MyConfig.h) //MySigningNone signer; //MySigningAtsha204Soft signer; //MySigningAtsha204 signer; // Hardware profile MyHwATMega328 hw; // Construct MySensors library (signer needed if MY_SIGNING_FEATURE is turned on in MyConfig.h) // To use LEDs blinking, uncomment WITH_LEDS_BLINKING in MyConfig.h #ifdef WITH_LEDS_BLINKING MySensor gw(transport, hw /*, signer*/, RADIO_RX_LED_PIN, RADIO_TX_LED_PIN, RADIO_ERROR_LED_PIN); #else MySensor gw(transport, hw /*, signer*/); #endif #define IP_PORT 5003 // The port you want to open IPAddress myIp (192, 168, 2, 62); // Configure your static ip-address here COMPILE ERROR HERE? Use Arduino IDE 1.5.7 or later! // The MAC address can be anything you want but should be unique on your network. // Newer boards have a MAC address printed on the underside of the PCB, which you can (optionally) use. // Note that most of the Ardunio examples use "DEAD BEEF FEED" for the MAC address. byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; // DEAD BEEF FEED // a R/W server on the port EthernetServer server = EthernetServer(IP_PORT); // handle to open connection EthernetClient client = EthernetClient(); char inputString[MAX_RECEIVE_LENGTH] = ""; // A string to hold incoming commands from serial/ethernet interface int inputPos = 0; bool sentReady = false; void output(const char *fmt, ... ) { va_list args; va_start (args, fmt ); vsnprintf_P(serialBuffer, MAX_SEND_LENGTH, fmt, args); va_end (args); Serial.print(serialBuffer); server.write(serialBuffer); } void setup() { Ethernet.begin(mac, myIp); setupGateway(INCLUSION_MODE_PIN, INCLUSION_MODE_TIME, output); // Add interrupt for inclusion button to pin PCintPort::attachInterrupt(pinInclusion, startInclusionInterrupt, RISING); // give the Ethernet interface a second to initialize delay(1000); // Initialize gateway at maximum PA level, channel 70 and callback for write operations gw.begin(incomingMessage, 0, true, 0); // start listening for clients server.begin(); } void loop() { gw.process(); checkButtonTriggeredInclusion(); checkInclusionFinished(); // if an incoming client connects, there will be // bytes available to read via the client object EthernetClient newclient = server.available(); // if a new client connects make sure to dispose any previous existing sockets if (newclient) { if (client != newclient) { client.stop(); client = newclient; output(PSTR("0;0;%d;0;%d;Gateway startup complete.\n"), C_INTERNAL, I_GATEWAY_READY); } } if (client) { if (!client.connected()) { client.stop(); } else if (client.available()) { // read the bytes incoming from the client char inChar = client.read(); if (inputPos<MAX_RECEIVE_LENGTH-1) { // if newline then command is complete if (inChar == '\n') { Serial.println("Finished"); // a command was issued by the client // we will now try to send it to the actuator inputString[inputPos] = 0; // echo the string to the serial port Serial.print(inputString); parseAndSend(gw, inputString); // clear the string: inputPos = 0; } else { // add it to the inputString: inputString[inputPos] = inChar; inputPos++; } } else { // Incoming message too long. Throw away inputPos = 0; } } } } -
@gregl or anyone with info
this is the second iboard gateway to be set up for me. The first went off without a hitch. It was and is still up and running flawlessly, how ever there is aproblem I have to day.
I believe I have used the same program as is indicated in this thread and have done so by the h/w method.
When using the arduino 1.6.5 IDE and set to Duemilove board 328 processer and proper USB port, when using the serial moniter the message "0,0,3,0,14 gateway started " is what is shown.
However when Iboard is plugged into Ethernet port on modem, there is no interaction on the vera 3 dashboard (ui5) and for the life of me I can not figure out the issue.
The power LED as well as LINK ,SPD, FDX are on steady with occasional blinks of the Rx led
suggesting there is some communication between iboard and modem. As there is no check wires, all in the board seems well.Any ideas on the problemI? I have tried different rf24 and power supplies or have I forgot to do something with the vera. I had usb gateway but it has been deleted from vera3.
Thanks doug.Edit When I go to the router and inspect for connected things the Iboard does show up under the proper reserved ip (10.0.0.20) with port 5003.
This unit is in remote home and first unit is at residence, both with own vera but both use the same mac dead beef feed.
-
@gregl or anyone with info
this is the second iboard gateway to be set up for me. The first went off without a hitch. It was and is still up and running flawlessly, how ever there is aproblem I have to day.
I believe I have used the same program as is indicated in this thread and have done so by the h/w method.
When using the arduino 1.6.5 IDE and set to Duemilove board 328 processer and proper USB port, when using the serial moniter the message "0,0,3,0,14 gateway started " is what is shown.
However when Iboard is plugged into Ethernet port on modem, there is no interaction on the vera 3 dashboard (ui5) and for the life of me I can not figure out the issue.
The power LED as well as LINK ,SPD, FDX are on steady with occasional blinks of the Rx led
suggesting there is some communication between iboard and modem. As there is no check wires, all in the board seems well.Any ideas on the problemI? I have tried different rf24 and power supplies or have I forgot to do something with the vera. I had usb gateway but it has been deleted from vera3.
Thanks doug.Edit When I go to the router and inspect for connected things the Iboard does show up under the proper reserved ip (10.0.0.20) with port 5003.
This unit is in remote home and first unit is at residence, both with own vera but both use the same mac dead beef feed.
@5546dug It sounds like everything is working correctly with the iBoard itself, did you configure the MySensors plugin for the IP of the GW? When I switched from serial GW to iBoard, I did not delete the plugin, I just entered the IP Addy in the plugin settings and boom, everything worked, and zero hiccups with the GW ever since.
-
Dear All,
I just buyed an iboard and following your instruction I tried to get it working in my domoticz configuration, but without success.
As at today MySensors library is updated to ver. 2, can you please tell me how to proceed in order to have it working correctly ?
I used the sketch available in MySensors Library in my arduino IDE 1.6.13, but I never able to ping it from my computer.
As for now I prefere don't go for hardware modification, can you please suggest me what kind of modification I have to do and where I have to do it ?
Because I don't know if I have to modify only the sketch or if I have to modify the file MyConfig.h or what other file I have to modify.
Thank you in advance for your help.
-
Dear All,
I just buyed an iboard and following your instruction I tried to get it working in my domoticz configuration, but without success.
As at today MySensors library is updated to ver. 2, can you please tell me how to proceed in order to have it working correctly ?
I used the sketch available in MySensors Library in my arduino IDE 1.6.13, but I never able to ping it from my computer.
As for now I prefere don't go for hardware modification, can you please suggest me what kind of modification I have to do and where I have to do it ?
Because I don't know if I have to modify only the sketch or if I have to modify the file MyConfig.h or what other file I have to modify.
Thank you in advance for your help.
Try this sketch:
/** * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each * repeater and gateway builds a routing tables in EEPROM which keeps track of the * network topology allowing messages to be routed to nodes. * * Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Copyright (C) 2013-2015 Sensnology AB * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * * Documentation: http://www.mysensors.org * Support Forum: http://forum.mysensors.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * ******************************* * * REVISION HISTORY * Version 1.0 - Henrik EKblad * Contribution by a-lurker and Anticimex, * Contribution by Norbert Truchsess <norbert.truchsess@t-online.de> * Contribution by Tomas Hozza <thozza@gmail.com> * * * DESCRIPTION * The EthernetGateway sends data received from sensors to the ethernet link. * The gateway also accepts input on ethernet interface, which is then sent out to the radio network. * * The GW code is designed for Arduino 328p / 16MHz. ATmega168 does not have enough memory to run this program. * * LED purposes: * - To use the feature, uncomment WITH_LEDS_BLINKING in MyConfig.h * - RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly * - ERR (red) - fast blink on error during transmission error or recieve crc error * * See http://www.mysensors.org/build/ethernet_gateway for wiring instructions. * */ // Enable debug prints to serial monitor //#define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 // Enable gateway ethernet module type #define MY_GATEWAY_W5100 #define MY_RF24_PA_LEVEL RF24_PA_MAX // signing //#define MY_SIGNING_SOFT //#define MY_SIGNING_REQUEST_SIGNATURES // Enable Soft SPI for NRF radio (note different radio wiring is required) // The W5100 ethernet module seems to have a hard time co-operate with // radio on the same spi bus. #if !defined(MY_W5100_SPI_EN) && !defined(ARDUINO_ARCH_SAMD) #define MY_SOFTSPI #define MY_SOFT_SPI_SCK_PIN 7 #define MY_SOFT_SPI_MISO_PIN 6 #define MY_SOFT_SPI_MOSI_PIN 5 #endif // When W5100 is connected we have to move CE/CSN pins for NRF radio #define MY_RF24_CE_PIN 3 #define MY_RF24_CS_PIN 8 #define MY_IP_ADDRESS 192,168,2,2 // If this is disabled, DHCP is used to retrieve address // The port to keep open on node server mode / or port to contact in client mode #define MY_PORT 5003 // The MAC address can be anything you want but should be unique on your network. // Newer boards have a MAC address printed on the underside of the PCB, which you can (optionally) use. // Note that most of the Ardunio examples use "DEAD BEEF FEED" for the MAC address. #define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED #include <SPI.h> #if defined(MY_USE_UDP) #include <EthernetUdp.h> #endif #include <Ethernet.h> #include <MySensors.h> void setup() { } void loop() { } -
Thank you very much for your help, now I succesfully connected my iboard card as LAN Gateway without doing any HW modification and even any software modification to any library, simply using the sketch you sent here.
For general information to other people that want to use the iboard card with Domoticz, to avoid any problem like the following:
2016-12-18 12:06:40.840 MySensors: trying to connect to: 192.168.1.133:5603
2016-12-18 12:06:41.841 MySensors: connected to: 192.168.1.133:5603
2016-12-18 12:06:45.841 MySensors: Connection reset!
2016-12-18 12:06:45.842 TCP: Reconnecting in 30 seconds...Consider to use the Arduino IDE 1.6.8 to compile and upload the sketch, otherwise, with newest Arduino IDE you will get the error messages above.
Thank you again for you help and a big hello to all the members of the forum.
Regards