Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. hugob
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    hugob

    @hugob

    2
    Reputation
    11
    Posts
    760
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    hugob Follow

    Best posts made by hugob

    • RE: Iboard - Cheap Single board Ethernet Arduino with Radio

      I am using the Itead iBoard as a gateway to a Vera Light for a few days now. Without any hardware modifications, only a few changes in header files required. I think the main issue is that you should map the inclusion button and led's to the Ax pins and use the full constructor (with 7 parameters). Beware of the last line in the first snippet. If you use the shortcut constructor (with three parameters), it will use defaults for the other parameters and your defs will be ignored.
      To verify my assumptions above, I included a led to the A2 pin and it is blinking as expected on arrival of a packet.
      The code below may look intimidating. But I posted the whole thing for easy reference. You can do the software changes in one minute.

      Hugo

      Snippet from EthernetGateway.ino:

      #define INCLUSION_MODE_TIME 1 // Number of minutes inclusion mode is enabled
      #define INCLUSION_MODE_PIN  14 //A0 // 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 15 //A1 // Error led pin
      #define RADIO_RX_LED_PIN    16 //A2 // Receive led pin
      #define RADIO_TX_LED_PIN    17 //A3 // the PCB, on board LED
      
      #define IP_PORT 5003        // The port you want to open 
      IPAddress myIp (192, 168, 178, 66);  // 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);
      
      // No blink or button functionality. Use the vanilla constructor.
      //MyGateway gw(RADIO_CE_PIN, RADIO_SPI_SS_PIN, INCLUSION_MODE_TIME);
      
      // Uncomment this constructor if you have leds and include button attached to your gateway 
      MyGateway gw(RADIO_CE_PIN, RADIO_SPI_SS_PIN, INCLUSION_MODE_TIME, INCLUSION_MODE_PIN, RADIO_RX_LED_PIN, RADIO_TX_LED_PIN, RADIO_ERROR_LED_PIN);
      

      Snippet from \Arduino\libraries\MySensors\utility\RF24_config.h

      #define MINIMAL
        //#define SPI_UART  // Requires library from https://github.com/TMRh20/Sketches/tree/master/SPI_UART
        #define SOFTSPI   // Requires library from https://github.com/greiman/DigitalIO
        /**********************/
        
        // Define _BV for non-Arduino platforms and for Arduino DUE
      #if defined (ARDUINO) && !defined (__arm__)
      	#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) || defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)
      		#define RF24_TINY
      		#define _SPI SPI
      	#else
      	  #if defined SPI_UART
      		#include <SPI_UART.h>
      		#define _SPI uspi
      	  #elif defined SOFTSPI
      	  // change these pins to your liking
      	  //
      	  const uint8_t SOFT_SPI_MISO_PIN = 6; 
      	  const uint8_t SOFT_SPI_MOSI_PIN = 5; 
      	  const uint8_t SOFT_SPI_SCK_PIN = 7;  
      	  const uint8_t SPI_MODE = 0;
      	  #define _SPI spi
      		  #else	    
      		#include <SPI.h>
      		#define _SPI SPI
      	  #endif
      	#endif
      #else
      posted in Hardware
      hugob
      hugob
    • RE: Iboard - Cheap Single board Ethernet Arduino with Radio

      @gregl
      Good to hear that you can confirm that this is working. My unmodified IBoard gateway is working for months now without problems. But as I said in some other topic, this board needs a decent power supply.
      So all you need for a MySensors Ethernet gateway is this board, a NRF24L01 Radio that plugs in into this board, and a power supply. No mess with cables like in http://www.mysensors.org/build/ethernet_gateway. This board has 7 IO ports in case you want the leds. For $17.50 this is a no brainer.

      posted in Hardware
      hugob
      hugob

    Latest posts made by hugob

    • RE: Everything nRF52840

      Sorry for cross-posting.

      I started with nRF52 a few days ago. I have the Nordic nRF52 SDK board (PCA10056) with a nRF52840 operational as a MySensors serial gateway together with Home Assistant on a RaspberryPI (with Hass.io). I am using the Arduino nRF5 and the sandeepmistry nRF5 board libraries.

      Some issues:
      - It looks like it only works in debug mode. But in debug mode, both debug messages and gateway messages appear on the usb port. Homes Assistant is not confused by the debug messages.
      - Leds are not working.
      - The programmer on the Arduino IDE is not working for me ("No J-Link" error, while there is a J-Link interface available), so I export a HEX fle form Arduino IDE and program the board with the nRFConnect tool from Nordic.

      In order to solve the issues above, I installed the Segger environment. With the board you get a free license from Nordic and you can do some fancy debugging. I also looked at Keil but that is a no-go for me. With Segger, I can upload a simple Blink example from Nordic to the board an debug it. I am now struggling with importing the MySensors library sources in Segger. If someone did this before, please let me know (!). Once this is done, I can debug the code on the hardware. May be I could fix the issues, like non blinking leds, by inspecting the code and watch for configuration issues of the ports (the addressing of the ports seems to be OK). But being able to debug would be a big plus in future development.

      Off course, once the gateway is working with blinking leds, I want to replace the development board with something cheaper from E-Bay et al. I want to give this one a try:
      https://www.aliexpress.com/item/Nordic-nRF52840-module-Bluetooth-low-energy-long-range-500-meters-bluetooth-5-0-PCB-IPX-Antenna/32953759053.html
      The plus of this board is that you can use an external 2.4 Ghz antenna. And it has the newest 52840. If you are creating a gateway, I suppose your budget will not depend on $3 price difference.

      Once all that is done, I want to turn my Nordic Thingy (https://www.nordicsemi.com/eng/Products/Nordic-Thingy-52) into a MySensors device. Seems like doable. But someone has to do it.

      posted in Hardware
      hugob
      hugob
    • RE: my first nrf5 ... NRF51/NRF52 which is better for MySensors ?

      Just discovered that this thread covers about the same topic I addressed:
      https://forum.mysensors.org/topic/9717/everything-nrf52840
      Sorry.

      posted in Hardware
      hugob
      hugob
    • RE: my first nrf5 ... NRF51/NRF52 which is better for MySensors ?

      I started with nRF52 a few days ago. I have the Nordic nRF52 SDK board (PCA10056) with a nRF52840 operational as a MySensors serial gateway together with Home Assistant on a RaspberryPI (with Hass.io). I am using the Arduino nRF5 and the sandeepmistry nRF5 board libraries.

      Some issues:
      - It looks like it only works in debug mode. But in debug mode, both debug messages and gateway messages appear on the usb port. Homes Assistant is not confused by the debug messages.
      - Leds are not working.
      - The programmer on the Arduino IDE is not working for me ("No J-Link" error, while there is a J-Link interface available), so I export a HEX fle form Arduino IDE and program the board with the nRFConnect tool from Nordic.

      In order to solve the issues above, I installed the Segger environment. With the board you get a free license from Nordic and you can do some fancy debugging. I also looked at Keil but that is a no-go for me. With Segger, I can upload a simple Blink example from Nordic to the board an debug it. I am now struggling with importing the MySensors library sources in Segger. If someone did this before, please let me know (!). Once this is done, I can debug the code on the hardware. May be I could fix the issues, like non blinking leds, by inspecting the code and watch for configuration issues of the ports (the addressing of the ports seems to be OK). But being able to debug would be a big plus in future development.

      Off course, once the gateway is working with blinking leds, I want to replace the development board with something cheaper from E-Bay et al. I want to give this one a try:
      https://www.aliexpress.com/item/Nordic-nRF52840-module-Bluetooth-low-energy-long-range-500-meters-bluetooth-5-0-PCB-IPX-Antenna/32953759053.html
      The plus of this board is that you can use an external 2.4 Ghz antenna. And it has the newest 52840. If you are creating a gateway, I suppose your budget will not depend on $3 price difference.

      Once all that is done, I want to turn my Nordic Thingy (https://www.nordicsemi.com/eng/Products/Nordic-Thingy-52) into a MySensors device. Seems like doable. But someone has to do it.

      posted in Hardware
      hugob
      hugob
    • RE: Iboard - Cheap Single board Ethernet Arduino with Radio

      @5546dug

      In the original sketch, you map a variable to a Dn pin. E.g. INCLUSION_MODE_PIN is mapped to pin 3.
      The iBoard has no digital ports (Dn) on a connector, but only analog ports (An). Luckily, the analog ports can also be used as digital ports. The modified sketch maps the variables that were mapped to a Dn port in the oririginal sketch, to an An port in the modified sketch. This is the list:

      Original
      INCLUSION_MODE_PIN 3 // Digital pin used for inclusion mode button
      RADIO_ERROR_LED_PIN 7 // Error led pin
      RADIO_RX_LED_PIN 8 // Receive led pin
      RADIO_TX_LED_PIN 9 // the PCB, on board LED

      Modified
      INCLUSION_MODE_PIN 14 // A0 Digital pin used for inclusion mode button
      RADIO_ERROR_LED_PIN 15 // A1 Error led pin
      RADIO_RX_LED_PIN 16 // A2 Receive led pin
      RADIO_TX_LED_PIN 17 // A3 the PCB, on board LED

      So for the iBoard, the receive LED has to be connected to pin 16 (A2). Etc.

      If you carefully look at the code, you will notice that also RADIO_SPI_SS_PIN changed from 6 to 8. That is because the header for the radio chip on the iBoard is connected to a different Arduino pin on the iBoard, than it is on the wiring diagram of the original gateway diagram. But this is just an internal issue. It should not bother you if you build the gateway.

      posted in Hardware
      hugob
      hugob
    • RE: Iboard - Cheap Single board Ethernet Arduino with Radio

      OK, I did forget some minor drawback. You need a FTDI adapter to program this IBoard from the Arduino UI.

      posted in Hardware
      hugob
      hugob
    • RE: Iboard - Cheap Single board Ethernet Arduino with Radio

      @gregl
      Good to hear that you can confirm that this is working. My unmodified IBoard gateway is working for months now without problems. But as I said in some other topic, this board needs a decent power supply.
      So all you need for a MySensors Ethernet gateway is this board, a NRF24L01 Radio that plugs in into this board, and a power supply. No mess with cables like in http://www.mysensors.org/build/ethernet_gateway. This board has 7 IO ports in case you want the leds. For $17.50 this is a no brainer.

      posted in Hardware
      hugob
      hugob
    • RE: iTead Studio iBoard MySensors Edition

      My unmodified iBoard is working for months now as a gateway without problems. Initially I had some problems with hanging connections. But these problems disappeared after replacing my 1$ power supply with a 3$ one. The iBoard needs a decent power supply.

      posted in Hardware
      hugob
      hugob
    • RE: iTead Studio iBoard MySensors Edition

      You can use the unmodified iBoard with a few simple changes in the pin definitions in the RF24_config.h and the sketch. Use the full constructor (not the shortcut with less parameters that will use defaults for missing parameteres and neglect your definitions).
      See my post
      http://forum.mysensors.org/topic/224/iboard-cheap-single-board-ethernet-arduino-with-radio/47

      posted in Hardware
      hugob
      hugob
    • RE: Iboard - Cheap Single board Ethernet Arduino with Radio

      I am using the Itead iBoard as a gateway to a Vera Light for a few days now. Without any hardware modifications, only a few changes in header files required. I think the main issue is that you should map the inclusion button and led's to the Ax pins and use the full constructor (with 7 parameters). Beware of the last line in the first snippet. If you use the shortcut constructor (with three parameters), it will use defaults for the other parameters and your defs will be ignored.
      To verify my assumptions above, I included a led to the A2 pin and it is blinking as expected on arrival of a packet.
      The code below may look intimidating. But I posted the whole thing for easy reference. You can do the software changes in one minute.

      Hugo

      Snippet from EthernetGateway.ino:

      #define INCLUSION_MODE_TIME 1 // Number of minutes inclusion mode is enabled
      #define INCLUSION_MODE_PIN  14 //A0 // 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 15 //A1 // Error led pin
      #define RADIO_RX_LED_PIN    16 //A2 // Receive led pin
      #define RADIO_TX_LED_PIN    17 //A3 // the PCB, on board LED
      
      #define IP_PORT 5003        // The port you want to open 
      IPAddress myIp (192, 168, 178, 66);  // 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);
      
      // No blink or button functionality. Use the vanilla constructor.
      //MyGateway gw(RADIO_CE_PIN, RADIO_SPI_SS_PIN, INCLUSION_MODE_TIME);
      
      // Uncomment this constructor if you have leds and include button attached to your gateway 
      MyGateway gw(RADIO_CE_PIN, RADIO_SPI_SS_PIN, INCLUSION_MODE_TIME, INCLUSION_MODE_PIN, RADIO_RX_LED_PIN, RADIO_TX_LED_PIN, RADIO_ERROR_LED_PIN);
      

      Snippet from \Arduino\libraries\MySensors\utility\RF24_config.h

      #define MINIMAL
        //#define SPI_UART  // Requires library from https://github.com/TMRh20/Sketches/tree/master/SPI_UART
        #define SOFTSPI   // Requires library from https://github.com/greiman/DigitalIO
        /**********************/
        
        // Define _BV for non-Arduino platforms and for Arduino DUE
      #if defined (ARDUINO) && !defined (__arm__)
      	#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) || defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)
      		#define RF24_TINY
      		#define _SPI SPI
      	#else
      	  #if defined SPI_UART
      		#include <SPI_UART.h>
      		#define _SPI uspi
      	  #elif defined SOFTSPI
      	  // change these pins to your liking
      	  //
      	  const uint8_t SOFT_SPI_MISO_PIN = 6; 
      	  const uint8_t SOFT_SPI_MOSI_PIN = 5; 
      	  const uint8_t SOFT_SPI_SCK_PIN = 7;  
      	  const uint8_t SPI_MODE = 0;
      	  #define _SPI spi
      		  #else	    
      		#include <SPI.h>
      		#define _SPI SPI
      	  #endif
      	#endif
      #else
      posted in Hardware
      hugob
      hugob
    • RE: My Ethernet Gateway with custom case.

      Nice project. I am am interested in two things:

      • I want to use the same board. Can you tell what modifications you did to the gateway software to get this working. I guess you are using the analog inputs on the board configured as digital outputs to drive the leds.
      • The case is nice, but it is on sale for $270 (with a HP wireless access point inside).. How did you get the case?
      posted in My Project
      hugob
      hugob