๐Ÿ’ฌ Sensebender Gateway


  • Admin

    @korttoma
    Like @anticimex said, you will loose possibility of using the serial port if you use the dtm/dfm lines.

    But besides that, you are free to use all the ports as digital input/output, except the i2c pins as we have an i2c eeprom that is connected to the same pins.


  • Hero Member

    Thanks @Anticimex and @tbowmo I have the GW up and running with one external sensor now. I just need to connect the buttons and relays to test those.

    I'm not sure if I will ever need the UART pins but I will make the hardware so that I can easily change the pins used for buttons and relays.

    btw, what is the use cases for UART pins?


  • Contest Winner

    @korttoma if you have peripherals on your daughter board that communicate using a serial protocol it makes sense to leverage any hw UART capable blocks on the main board. The MYSX standard just indicate that if the main board has such capability, the interface is available on those two pins. You can of course bit bang it on any digital io (depending on core clock) if you need several interfaces.


  • Contest Winner

    @korttoma that said, note that the dtm and dfm pins also serves as general digital io, so you can use them like any Dx pin.


  • Hero Member

    Button and relay pins I assigned seem to work correctly but now I managed to release some magic smoke from the Sensebender GW board ๐Ÿ˜ž shorted something by mistake and at least FB1 is tost. Can I just shor FB1 to see if the board is stil alive or do I have to replace FB1? Seems like nothing else was damaged (at least I hope so) since it was GND and Vraw that was shorted.

    Edit: Just confirmed that it is only FB1 that was destroyed the rest seems to work ๐Ÿ˜„ just cant power it from the USB anymore. Hope I can stil write to it.


  • Admin

    @korttoma said in ๐Ÿ’ฌ Sensebender Gateway:

    Button and relay pins I assigned seem to work correctly but now I managed to release some magic smoke from the Sensebender GW board ๐Ÿ˜ž shorted something by mistake and at least FB1 is tost. Can I just shor FB1 to see if the board is stil alive or do I have to replace FB1? Seems like nothing else was damaged (at least I hope so) since it was GND and Vraw that was shorted.

    Edit: Just confirmed that it is only FB1 that was destroyed the rest seems to work ๐Ÿ˜„ just cant power it from the USB anymore. Hope I can stil write to it.

    FB1 is just a filter to suppress spurious RF (if any) on the gnd wire exiting the board. So it can be shorted. The gateway should function fine without it.



  • Hi All,
    I have purchased a SenseBender Gateway, tested the MySensors MQTT code etc on it and thats all good.
    Now I want to experiment with my own code on it. I notice that in the example code there are some references to the onboard LEDs, such as;

    static uint8_t leds[] = {LED_BLUE, LED_RED, LED_GREEN, LED_YELLOW, LED_ORANGE};

    which is great, I will use those to manage the LEDs in my sketch.
    What I'd like to know is where are LED_BLUE, LED_RED etc actually defined? What file? The reason I ask is that I also want to know which pin is connected to the RFM69 RESET pin. On the schematic for the SenseBender it is labelled RESET_RFM on the SAMD21 chip, and is physical chip pin 23 and also PB10. I don't know how to use that in my sketch, so if I had a macro like there is for the LEDs then I could just call that.
    I'm assuming that if I find where LED_BLUE is defined I may find info about the other pins I also want to use ๐Ÿ™‚

    Thanks,
    Paul


  • Admin



  • @hek thanks, Now I understand.
    I was poking around near that file before, but could not figure it out.
    Thanks again,
    Paul


  • Hero Member

    Received a new ferrite bead and soldered it to my device. The bead showed 0 ohm with a multimeter so I don't know if it is the real deal but it seems to work even if it is not pretty:

    0_1509948945658_20171106_080332.jpg


  • Admin

    at DC it should be close to 0 ohm, but on higher frequencies it should act as a resistor.

    btw. it seems like the old one had exploded? ๐Ÿ™‚


  • Hero Member

    @tbowmo said in ๐Ÿ’ฌ Sensebender Gateway:

    it seems like the old one had exploded?

    That's what happens when you short Vraw to GND on the MYSX connector in one of those facepalm moments ๐Ÿ˜„ (we need an :facepalm emoji!).

    alt text



  • I have a lot of problem with this gateway. First I think it was caused by network module but with serial sketch I have a lot of issues. After 2 or 3 days, gateway crash. If I remove some sensors reporting every 30 seconds it crash but later.
    This morning, all leds are off on the board. After powering off and on it was ok.
    I'im using RFM69 with Openhab2 as controller.
    Is someone experience same issue ? I will fall back to my old Jeelink gateway (ATmega328 based).


  • Admin

    I have used my sensebender gateway for more than a year now, only difference is that I use NRF24 radio.. Haven't had any hickups yet..

    Which version of mysensors are you using?



  • I'm using version 2.1


  • Admin

    @Fabien

    Could you try the latest dev, and see how that behaves?



  • @tbowmo : with wich RFM69 driver ?


  • Admin

    @Fabien legacy, unless you would reflash all your nodes with the new driver as well. (they are not compatible)



  • @tbowmo : Just flash my SBGW today with arduino 1.8.5, last boards.txt and dev branch of mysensors.
    We will see if it's more stable. All my Node still in 2.1.1



  • Which driver to use on Ubuntu 16.04 ?



  • Hi, I'm trying to activate a sensebender gateway in OH2 on Ubuntu 16.04, however I'm having trouble setting up the serial port. Is there a how-to somewhere ? I suspect the serial port name is /dev/ttyACM0, but I'm not sure. How can I test ?
    MySensors bundle is reported to be active, but there's no messages coming in. I set the log level for mysensors to DEBUG, but nothing on the log.



  • Here is my configuration file (mysensors.things)
    Bridge mysensors:bridge-ser:gateway [ serialPort="/dev/ttyACM0", sendDelay=200 ]
    {
    humidity keuken_vochtigheid [ nodeId="3", childId="2", smartSleep=true ]
    temperature keuken_temperatuur [ nodeId="3", childId="1", smartSleep=true ]
    }

    I suppose ttyACM0 because of
    stefaan@home:~$ dmesg |grep -i tty
    [ 0.000000] console [tty0] enabled
    [ 22.328631] 8086228A:00: ttyS4 at MMIO 0x81420000 (irq = 39, base_baud = 2764800) is a 16550A
    [ 22.329059] 8086228A:01: ttyS5 at MMIO 0x8141e000 (irq = 40, base_baud = 2764800) is a 16550A
    [ 23.106128] usb 1-4: FTDI USB Serial Device converter now attached to ttyUSB0
    [362074.592743] cdc_acm 1-3:1.0: ttyACM0: USB ACM device

    There seems to be a premissions problem om the port :
    stefaan@home:~$ cat /dev/ttyACM0
    cat: /dev/ttyACM0: Permission denied

    doing 'sudo usermod -a -G dialout openhab' doesn't help

    Anyone any ideas ?



  • ttyUSB0 is a (different) RFXcom device



  • @stefaanv I can only suggest scanning the ports. When I connected the Gateway to the Pi3 it came up with /dev/ttyS0 instead of the listed options, although I ultimately ended up changing to a Pro-Mini as the radio did not work, and connected direct to the GPIO the serial port it worked with.


  • Admin

    it should pop up as ttyACM0 or ttyACM1 (if you have another usb device that enumerates first and gets ttyACM0)

    I added the following to /etc/udev/rules.d/10-local.rules file:

    ACTION=="add", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6949", SYMLINK+="ttyNRF24"
    

    What that does is to create a symlink from the real device to ttyNRF24, so regardless of what I add to my rPI, i always know that ttyNRF24 is for my gateway.

    (and then I use /dev/ttyNRF24 for the serial port in my controller)



  • @tbowmo Definately ttyACM0
    However, the setserial command returns information that doesn't look good : port0 and IRQ0. Does the board need a driver under Linux ?

    stefaan@home:~$ sudo setserial /dev/ttyACM0
    /dev/ttyACM0, UART: unknown, Port: 0x0000, IRQ: 0, Flags: low_latency```

  • Admin

    @stefaanv

    No, it doesn't need a driver..

    I get the same for mine, if I use setserial:

    thomas at jarvis in ~ 
    >sudo setserial /dev/ttyNRF24 
    /dev/ttyNRF24, UART: unknown, Port: 0x0000, IRQ: 0, Flags: low_latency
    thomas at jarvis in ~ 
    >ll /dev/ttyNRF24 
    lrwxrwxrwx 1 root root 7 nov 11 13:39 /dev/ttyNRF24 -> ttyACM1
    

    Btw. the permission problem.. You are logged in using your normal user (stefaan) and then you set permissions for openhab user? (see below). Have you tried setting the permissions for your user, and then cat /dev/ttyACM0?

    @stefaanv said in ๐Ÿ’ฌ Sensebender Gateway:

    There seems to be a premissions problem om the port :
    stefaan@home:~$ cat /dev/ttyACM0
    cat: /dev/ttyACM0: Permission denied

    doing 'sudo usermod -a -G dialout openhab' doesn't help

    Anyone any ideas ?



  • @tbowmo OK, is working now after restarting the bundle in OH.
    Must have been the permission problem after all.
    Thanks for your help !!



  • When I try to compile SensebenderGW sketch with signing features, I receive a bunch of errors. What am I missing?

    Arduino: 1.8.5 (Windows Store 1.8.10.0) (Windows 10), Board: "Sensebender Gateway"

    In file included from C:\Users\rzylius\AppData\Local\Temp\arduino_modified_sketch_737033\SensebenderGatewaySerial.ino:88:0:

    C:\Users\rzylius\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\rzylius\Documents\Arduino\libraries\MySensors/MySensors.h:131:0,

                 from C:\Users\rzylius\AppData\Local\Temp\arduino_modified_sketch_737033\SensebenderGatewaySerial.ino:86:
    

    C:\Users\rzylius\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\rzylius\AppData\Local\Temp\arduino_modified_sketch_737033\SensebenderGatewaySerial.ino:88:0:

    C:\Users\rzylius\Documents\Arduino\libraries\MySensors/drivers/ATSHA204/ATSHA204.cpp: In function 'void swi_set_signal_pin(uint8_t)':

    C:\Users\rzylius\Documents\Arduino\libraries\MySensors/drivers/ATSHA204/ATSHA204.cpp:24:13: error: redefinition of 'void swi_set_signal_pin(uint8_t)'

    static void swi_set_signal_pin(uint8_t is_high)

             ^
    

    In file included from C:\Users\rzylius\Documents\Arduino\libraries\MySensors/MySensors.h:131:0,

                 from C:\Users\rzylius\AppData\Local\Temp\arduino_modified_sketch_737033\SensebenderGatewaySerial.ino:86:
    

    C:\Users\rzylius\Documents\Arduino\libraries\MySensors/drivers/ATSHA204/ATSHA204.cpp:24:13: error: 'void swi_set_signal_pin(uint8_t)' previously defined here

    static void swi_set_signal_pin(uint8_t is_high)

             ^
    

    and the same type of errors reoccurs multiple times.


  • Contest Winner

    @rzylius I think you have an #include in the sketch for the atsha driver. Try to remove that #include from the sketch.



  • @Anticimex yes, when I delete #include atsha driver line, it compiles well. thanks.



  • @tbowmo After 2 month on the dev version, no more problem with the gateway. Perhaps it's time to made a new stable release ?


  • Admin

    @Fabien

    It's on the todo list.. ๐Ÿ™‚



  • I am looking for Gateway that will get me the results to MQTT but will support encryption + signing. That mean it should be easy to add new signatures (recompile/reflash) the module

    I suppose if I use Sensebender with LAN module it will be a pain to do that

    Is this doable if I use Orange zero as USB host for the Sensbender and let it act as serial gateway, then convert serial to mqtt with software on the Linux side? Also is it possible to reflash it easily this way? I do not want to rewire the hardware each time a add new node.


  • Admin

    @8667

    Is it over the air encryption / signing that you are aiming after? Then that is possible with the gateway, it has the ATSHA204 onboard for signing capabilities. And it also works with the W5100 module attached. The Gateway have 256Kb of flash onboard, so it has "enough" room for both network stack, and signing.



  • Are there performance limitations to be considered for mysensors and SensebenderGW specifically. Will the gateway handle the load of signed communications if rules will be firing messages to different sensors like 1-2-5-10 per second?


  • Contest Winner

    @rzylius if you use the atsha204a chip, it is the single wire interface that limits your throughput. I have no figures, so best is to just test how fast you can push messages through. Of course there is overhead in the OTA handshaking as well. That would probably be the bottleneck if you use software based signing.



  • I see in logs, that the whole process of signing and communicating to the node takes a bit more than one second. I do not know how to make a stress test properly, so I hoped that somebody else did it ๐Ÿ™‚ my question is if gateway will handle load by putting messages in some pipeline, or I should try to make sure that messages are fired with some spaces.


  • Contest Winner

    @rzylius The signing process is blocking, so it should not accept messages if a signed message exchange is in progress. But I have not tested that extensively with "aggressive" controllers.



  • im trying to program in arduino ide, installed board... bu when compiling it write mi an error 'The current selected board needs the core 'arduino:arduino' that is not installed.'


  • Mod

    @mitja-blazinsek You'll need to install the Arduino SAMD board as well. I have just now updated the readme.



  • Just got my Sensebender GW and soldered it up. Adapted the serial sketch to Ethernet and it almost worked. Found some posts on this topic that helped me locate and fix my config error. Now all is well. Thanks! --edit-- added photo

    0_1517098910890_IMG_0889.JPG

    -d



  • @dklinkman said in ๐Ÿ’ฌ Sensebender Gateway:

    Sensebender

    And I got a Sensebender Micro soldered up and running also!! Just temp and humid so far. Too cool

    --edit-- picture

    0_1517282246688_20180129_215848.jpg


  • Hardware Contributor

    This post is deleted!


  • Is it possible to use the sensebender board as MQTT gateway? Not Ethernet?


  • Hardware Contributor

    Yes it is! I use I'm using it as a MQTT gateway for some time



  • First: Great work! My GW is working very well!
    I wanted to know for what I can use the SD-Card.
    My idea is to fetch the logs in the serial and write them to the SD-Card.
    But I don't know where. Is there a point in the mySensors core where I can fetch all logs?



  • Forgive me if this isn't the right place to ask; but as a beginner, where do I start? How can I order this thing, or any other stuff from OpenHardware.io ? I see so many design files, I'm not sure what to do with them. Soldering the thing I can probably manage, but is there a guide available how to order the PCB, and maybe the parts as well?



  • @rolandow said in ๐Ÿ’ฌ Sensebender Gateway:

    Forgive me if this isn't the right place to ask; but as a beginner, where do I start? How can I order this thing, or any other stuff from OpenHardware.io ? I see so many design files, I'm not sure what to do with them. Soldering the thing I can probably manage, but is there a guide available how to order the PCB, and maybe the parts as well?

    Sesnebender GW can be ordered from Itead:

    https://www.itead.cc/mysensors-gateway.html

    Other openhardware.io projects maybe ordered either (1) directly from a link; pcb only (2) you can download eagle files and upload them to pcb manufactures like oshpark.com (3) you can purchase the final product. So a generic answer to your question is it depends ๐Ÿ™‚

    I do not think there is a guide here, but if you go to oshpark.com there is a guide how to order a pcb. Parts (BOM) can be ordered from Aliexpress, eBay or more reputable supplies like digi-key or mouser



  • Hi!
    I'm trying to use sensebender GW as ethernet gateway. I loaded the stock W5100 sketch compiled with samd 1.6.21 defs but it didn't worked. I have been trying out different things and realized that it works with 1.6.12 defs. Now it's working but I'm stuck with an old version. Anyone with the same problem? Maybe I'm missing something?
    Also I found out ethernet library in 1.0.5 defs is outdated. I have been trying to use stock one (v2.0) without success. Anyone has tried?
    Thanks.


 

275
Online

8.4k
Users

9.3k
Topics

97.9k
Posts