Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
D

Dirk_H

@Dirk_H
Contest Winner
About
Posts
63
Topics
6
Shares
0
Groups
1
Followers
0
Following
0

Posts

Recent Best Controversial

  • Gateway W5100 with RFM69 fails to compile
    D Dirk_H

    @sundberg84 Hi, I'm not using level converters becuse I use a ProMini with 3,3V (with W5100 and rfm69hw).

    Maybe I have a small clue: The Interrupt Pin is high all the time. It seems that the interrupt request from the RFM Module is not processed. I cant see interrupts when I start a node. (With a working setup with ESP8266 and RFM69, the pin is low most of the time except when new packets arrive from a sensor).

    Troubleshooting

  • Gateway W5100 with RFM69 fails to compile
    D Dirk_H

    @sundberg84
    It does not work for me with softspi too. Although the debug output does not look that bad..

    MCO:BGN:INIT GW,CP=RPNGA---,FQ=16,REL=255,VER=2.3.2<\n>
    4 TSM:INIT<\n>
    5 TSF:WUR:MS=0<\n>
    8 TSM:INIT:TSP OK<\n>
    10 TSM:INIT:GW MODE<\n>
    12 TSM:READY:ID=0,PAR=0,DIS=0<\n>
    14 MCO:REG:NOT NEEDED<\n>
    577 GWT:TIN:IP=192.168.178.203<\n>
    1581 MCO:BGN:STP<\n>
    1583 MCO:BGN:INIT OK,TSP=1<\n>
    1585 TSM:READY:NWD REQ<\n>
    
    
    Troubleshooting

  • Gateway W5100 with RFM69 fails to compile
    D Dirk_H

    Hello,

    thank you scalz for the very good clarification.
    @sundberg84 I can confirm that it does compile with the #define MY_RFM69_NEW_DRIVER option. AFAIK Arduino changed the way setDataMode should be called (see links in first post). I'm not a SW-Expert but I think Someone would have to change the coresponding SoftSPI calls in the old RFM69 (old) driver if you want to use it. I currently use an ATMega2560+W5100+NRF24PA with SoftSPI which is working (but I do not know with which Arduino Verison it was compiled).

    I will go with the new driver. I think it takes some time until I really do the change in HW, because I have to change several productive nodes. As we have big heat at the moment and my lab is under the roof my motivation is currently not that high... :thermometer: :disappointed_relieved:

    Troubleshooting

  • Gateway W5100 with RFM69 fails to compile
    D Dirk_H

    Sorry for replying this late, just having some "real world" issues ;)
    Yes, with the new driver it works. Do we have a comparison about pros/cons of the new RFM69 driver. As I'm migrating all my nodes from nrf24 to rfm69 its no problem to use the new driver in all sketches. Just wondering what has changed in the new driver..

    Thanks, DirkH

    Troubleshooting

  • Gateway W5100 with RFM69 fails to compile
    D Dirk_H

    Hello,

    im trying to build a Gateway based on ATMEGA2560 with W5100 Ethnernet Chip and RF69 Radio Module.
    I'm using the stock GatewayW5100 from the MySensors Examples folder. Becuase I'm using a RF69 and not a NRF24 I disable the NRF24 driver and enable the RF69 Driver by (dis)commenting the specific lines.

    However my Arduino 1.8.8 gives me an error message: 'class SoftSPI<16u, 15u, 14u, 0u>' has no member named 'setDataMode'. Arduino.cc says that setDataMode shall not be used anymore. I think something is screwed up here...

    The debug output of Arduino says the following Versions are used:
    Bibliothek Ethernet in Version 2.0.0 im Ordner: D:\Program Files (x86)\Arduino\libraries\Ethernet wird verwendet
    Bibliothek MySensors in Version 2.3.2 im Ordner: D:\EigeneDaten\Dokumente\Arduino\libraries\MySensors wird verwendet
    Bibliothek SPI in Version 1.0 im Ordner: D:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI wird verwendet

    Source of the Gateway Sketch (only put a comment on #define MY_RADIO_RF24 and removed comment from #define MY_RADIO_RFM69.

    /*
     * 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-2019 Sensnology AB
     * Full contributor list: https://github.com/mysensors/MySensors/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 MY_DEFAULT_xxx_LED_PIN in the sketch below
     * - RX (green) - blink fast on radio message received. In inclusion mode will blink fast only on presentation received
     * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly
     * - ERR (red) - fast blink on error during transmission error or receive 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_RF24
    //#define MY_RADIO_NRF5_ESB
    #define MY_RADIO_RFM69
    //#define MY_RFM69_NEW_DRIVER
    //#define MY_RADIO_RFM95
    
    // Enable gateway ethernet module type
    #define MY_GATEWAY_W5100
    
    // W5100 Ethernet module SPI enable (optional if using a shield/module that manages SPI_EN signal)
    //#define MY_W5100_SPI_EN 4
    
    // 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 14
    #define MY_SOFT_SPI_MISO_PIN 16
    #define MY_SOFT_SPI_MOSI_PIN 15
    #endif
    
    // When W5100 is connected we have to move CE/CSN pins for NRF radio
    #ifndef MY_RF24_CE_PIN
    #define MY_RF24_CE_PIN 5
    #endif
    #ifndef MY_RF24_CS_PIN
    #define MY_RF24_CS_PIN 6
    #endif
    
    // Enable UDP communication
    //#define MY_USE_UDP  // If using UDP you need to set MY_CONTROLLER_IP_ADDRESS or MY_CONTROLLER_URL_ADDRESS below
    
    // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
    #define MY_IP_ADDRESS 192,168,178,66
    
    // If using static ip you can define Gateway and Subnet address as well
    //#define MY_IP_GATEWAY_ADDRESS 192,168,178,1
    //#define MY_IP_SUBNET_ADDRESS 255,255,255,0
    
    // Renewal period if using DHCP
    //#define MY_IP_RENEWAL_INTERVAL 60000
    
    // The port to keep open on node server mode / or port to contact in client mode
    #define MY_PORT 5003
    
    // Controller ip address. Enables client mode (default is "server" mode).
    // Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere.
    //#define MY_CONTROLLER_IP_ADDRESS 192, 168, 178, 254
    //#define MY_CONTROLLER_URL_ADDRESS "my.controller.org"
    
    // 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 Arduino examples use  "DEAD BEEF FEED" for the MAC address.
    #define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
    
    
    // Enable inclusion mode
    #define MY_INCLUSION_MODE_FEATURE
    // Enable Inclusion mode button on gateway
    //#define MY_INCLUSION_BUTTON_FEATURE
    // Set inclusion mode duration (in seconds)
    #define MY_INCLUSION_MODE_DURATION 60
    // Digital pin used for inclusion mode button
    //#define MY_INCLUSION_MODE_BUTTON_PIN  3
    
    // Set blinking period
    #define MY_DEFAULT_LED_BLINK_PERIOD 300
    
    // Flash leds on rx/tx/err
    // Uncomment to override default HW configurations
    //#define MY_DEFAULT_ERR_LED_PIN 7  // Error led pin
    //#define MY_DEFAULT_RX_LED_PIN  8  // Receive led pin
    //#define MY_DEFAULT_TX_LED_PIN  9  // Transmit led pin
    
    #if defined(MY_USE_UDP)
    #include <EthernetUdp.h>
    #endif
    #include <Ethernet.h>
    #include <MySensors.h>
    
    void setup()
    {
    	// Setup locally attached sensors
    }
    
    void presentation()
    {
    	// Present locally attached sensors here
    }
    
    void loop()
    {
    	// Send locally attached sensors data here
    }
    
    
    Troubleshooting

  • OTA flash types for MySensors
    D Dirk_H

    @LastSamurai The SST25VF020B... should work fine with the 2.0 developversion and #define MY_SPIFLASH_SST25TYPE set. It seems to be very close to the SST25PF020B I used. However keep an eye on the even more limited voltage range of the SST25VF Type which needs at least 2,7V which would be a problem if you want to power your circuit directly by 2xNiMH Batteries.

    The SST25VF512 needs also 2,7V but additionally does not support the 64k erase command (see my comments on that issue some posts above where I wrote something about the AT25F512).

    Hardware

  • OTA flash types for MySensors
    D Dirk_H

    About the AT25F512N wich was proposed by @AWI: tbowmo was right, I got confused by Sector, Page and Block erase. Like tbowmo said atmel does call blocks sectors... The AT25F512 does not support Block Erase 64k, which is defined but AFAIK not used in SPIFlash.cpp BUT it is used in the Bootloader if the "Imagesize" is > 32k. But I dont know how Image size is retrieved. Also I think for an ATMega 328p the image size should never be >32k. So this Flashtype could probably work as long as the image size is below 32k. I'd expect the Bootloader to crash or fail when program size is >32k.

    About the S25FL... @bjacobse proposed I see the problem that it does not support the Bock Erase 32k opcode which is used in SPIFlash.cpp and Bootloader. Both must be changed when S25FL... should be used. (I would emulate the 32k Block erase by 8 times 4k Block erase.) However remember that Dualoptiboot must also be altered which requires "non-arduino" programming and some work / knowlegde about makefiles / compiler/linker settings in IDE.

    Hardware

  • OTA flash types for MySensors
    D Dirk_H

    @AWI
    The AT25F512 (from Atmel?) is quiet different from the Adesto AT25DF512. As far as I can see the Atmel one seems not to have a Block erase command (32k/64k), which is used in MySensor AND in Bootloader code.

    If I'm not wrong with that assumption (and I dont think I am), I would NOT recommend to use the Atmel AT25F512.

    To all: please provide links to the Datasheet if you expect help... Its tedious to search them every time. Gulpman did great preparation work in his post above.

    Edit: Never mind what I said in this Post. I got confused with sectors pages and blocks :eyes: ... I'll write some more later.

    Hardware

  • OTA flash types for MySensors
    D Dirk_H

    Yes the AT25DF512 seems to outperform other memories and is truly a good chip. However unfortunately its hard to get in Germany (and maybe other parts of the world ;) ). The common distributors here do not have it in stock...

    Hardware

  • OTA flash types for MySensors
    D Dirk_H

    @tbowmo
    I looked at the defines inside the DualOptibootloader, I truly hope that there is no "hardcoded" opcode hidden somewhere... Assuming this, dualoptiboot does not write to the SPIFlash. It does erase, however thats not writing in this scope ;)

    #define SPIFLASH_STATUSWRITE      0x01        // write status register
    #define SPIFLASH_STATUSREAD       0x05        // read status register
    #define SPIFLASH_WRITEENABLE      0x06        // write enable
    #define SPIFLASH_ARRAYREADLOWFREQ 0x03        // read array (low frequency)
    #define SPIFLASH_BLOCKERASE_32K   0x52        // erase one 32K block of flash memory
    #define SPIFLASH_BLOCKERASE_64K   0xD8        // erase one 32K block of flash memory
    #define SPIFLASH_JEDECID          0x9F        // read JEDEC ID
    

    @Koresh please post a link to the datasheet. You can also check on your own: check if your spi-flash supports all commands listed in the SPIFlash.h defines. Of cause obvious things such as pinning and supply voltage range must also be checked.

    A caveeat I fell into, was that opcode 0x02 supports byte and pageprogramming for some SPI-Flash types but not for all (e.g. SST25 does not support pageprogramming but therefore has the AAI Wordprogramming feature).

    Hardware

  • OTA flash types for MySensors
    D Dirk_H

    @tbowmo
    I tested the complete chain with SST25. I.e. I prepared two sketches and uploaded them via OTA with MYSController and checked that the sketch changed via presentation Message.

    Dual Optiboot does not need modification because AFAIK it only reads from Flash, which works the same way for SST and other Flash Types.

    Hardware

  • OTA flash types for MySensors
    D Dirk_H

    @Gulpman @hek
    Hello everybody,
    I just added a pullrequest which will support SST25 Series flash for OTA Bootloader:
    https://github.com/mysensors/Arduino/pull/445

    SST25 Series flash mentioned by Gulpman as 1st and 2nd Alternative are currently not supported, because the dont support pagewriting with opcode 0x02. Instead they support Automatic Address Increment Word writing (opcode 0xAD). I updated teh SPIFlash.cpp and .h so they will take care of that if #define MY_SPIFLASH_SST25TYPE is set somewhere.
    I tested with this SPI Flash: http://www.reichelt.de/25PF020B80-4C-S/3/index.html?&ACTION=3&LA=446&ARTICLE=137365&artnr=25PF020B80-4C-S&SEARCH=25pf020b80 which is of Type SST25PF020B-80-4C-SAE (2MBit) and working now.

    I only hat a short look at the ISSI and Winbond flash Datasheets mentioned by Gulpman before. At first look I think they both could work with the current Mysensors / SPIFlash Version becuase they support Pagewriting with opcode 0x02 and seem to implement the other relevant opcodes. However I did not test..!

    Best Regards
    DirkH / D-H-R :)

    -edited on 2016-06-01 to take care of changed Name for define (added "MY_")

    Hardware

  • MYSBootloader 1.3 pre-release & MYSController 1.0.0beta
    D Dirk_H

    @Anduril I had problems with 8MHz with 3,3V and 115200kBPS. I only use 38400kBPS with my 8MHz nodes. (Of cause your Bootloader must also be set to the same Baudrate as specified in the board.txt, they must match, i.e. you cannot just change the Boards.txt and have another Baudrate for programming.)

    I'm not sure if @tekka is providing a Bootloader hex file with 38400kBPS and 8MHz. From his first post I'm assuming he ueses a 57600kBPS with 8MHz. This might also work, however 57600kBPS with 8MHz introduces a baud rate error of 3.5% which sometimes causes problems with my PC/FTDI Dongle. So I personally use 38400kBPS which only has 0.2% Error: http://wormfood.net/avrbaudcalc.php (fosc=8MHz)

    Development ota myscontroller mysbootloader

  • Windows GUI/Controller for MySensors
    D Dirk_H

    @gonzalonal @tekka
    Yes I can confirm the exact same behaviour gonzalonal describes. Please say if you need any more details tekka (with the @ function).

    Controllers myscontroller mysbootloader

  • [contest] 3D printed battery powered Wall Remote Control
    D Dirk_H

    @hek Thank you very much. I found out most of it the hard way (reading code and die trying). I did not found the document which wold have helped me very much. Is it mentioned in the Github Repo? Maybe you should put a link to it in the readme .md?

    Enclosures / 3D Printing hardware pcb contest 3d print

  • [SOLVED] Development branch: st=fails after node sleep
    D Dirk_H

    Glad it helped David. I just thought about it again, maybe sleep(0xff, 0x00, 0) does work too. I did not test it but I think it calls the same function anyway.

    However the method of direct calling sleep(0xff, 0x00, 0xff, 0x00, 0) should save some clocks because one less jmp is required :)

    Troubleshooting

  • [contest] 3D printed battery powered Wall Remote Control
    D Dirk_H

    1st you need to make sure that there is an active interrupt that wakes up the controller, otherwise the microcontroller will sleep forever.

    To solve your above Problem: remove the lines "sensor_node.RF24::powerDown();" and "LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF); //power everything down, wake up only by (PinChange) interrupts".

    Replace with "sleep(0xff, 0x00, 0xff, 0x00, 0);"
    Remember the things I mentioned above!

    Enclosures / 3D Printing hardware pcb contest 3d print

  • [contest] 3D printed battery powered Wall Remote Control
    D Dirk_H

    I'd try where the problem is, but I dont even get the MySesors class up and running. Is there already any API Reference/Documentation/Example for MySensors 2.0?

    Enclosures / 3D Printing hardware pcb contest 3d print

  • Multi Motion Detectors
    D Dirk_H

    @drock1985
    Hi good to hear that you found it out. I just made a third channel and in the message handler i react on both dimmer channels if a message with the third sensor is incoming (in my case sensor 0 for both channels; 1/2 for sepearte channels)

    However maybe its better to do the coupling of the channels in your home-automation.. I did it this way because maybe I want to build a remote and it should have the possiblity to set both channels with one mysensors message.

    regards
    DirkH

    Development

  • Multi Motion Detectors
    D Dirk_H

    @drock1985 What exactly do you need? In the project I mentioned is currently some more stuff with some dirty hacks I don't want necessarily to share ;)

    I think you only need the incoming message handler, or do you need more?

    Development
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular