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
dirkcD

dirkc

@dirkc
About
Posts
24
Topics
3
Shares
0
Groups
0
Followers
0
Following
1

Posts

Recent Best Controversial

  • single-click, double-click, long-press button possible with MySensors?
    dirkcD dirkc

    @ZenBlizzard , yes thanks, thats the point. How to deal with smartSleep() and battery lifetime.

    General Discussion

  • single-click, double-click, long-press button possible with MySensors?
    dirkcD dirkc

    Hi all,
    has anyone yet implemented some kind of multi tap button with MySensors?
    Such as single-click, double-click, long-press, ... ?

    I think, I cannot work with interrupts, as I can get a HIGH/LOW once only and cannot count for long-press? Correct? And a battery mode node cannot be used either (with smartSleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR_2),...) because I have to check for e.g. a long-press which might last some seconds ...

    Thanks in advance for any comment or code example?

    General Discussion

  • bootloaders
    dirkcD dirkc

    @terence-faul any solution so far?

    I found this:

    create a file, e.g. mysensors_bootloader_130_8Mhz.json and save it to ~/.platformio/boards/

    {
      "build": {
        "core": "arduino",
        "extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_PRO",
        "f_cpu": "8000000L",
        "mcu": "atmega328p",
        "variant": "standard"
      },
      "frameworks": [
        "arduino"
      ],
      "fuses": {
        "efuse": "0xFE",
        "hfuse": "0xD2",
        "lfuse": "0xE2",
        "lock": "0x0F",
        "unlock": "0x3F"
      },
      "name": "MySensorsBootloader 1.3.0 (Atmega328P@8M,3.3V)",
      "upload": {
        "maximum_ram_size": 2048,
        "maximum_size": 30720,
        "protocol": "arduino",
        "require_upload_port": true,
        "speed": 57600
      },
      "url": "http://www.mysensors.org",
      "vendor": "MySensors"
    }
    

    the platformio.ini should look like this:

    [env:mysensors_bootloader_130_8Mhz]
    platform = atmelavr
    framework = arduino
    board = MYSBootloader_8MHz.hex
    src_build_flags = -I/Users/dirk/Arduino/libraries/MySensors
    
    lib_deps =
      # Using a library name
    

    but I do not know where to store the MYSBootloader_8MHz.hex

    General Discussion

  • Atmega328 internal temperature sensor (yes it exists!)
    dirkcD dirkc

    @mfalkvidd said in Atmega328 internal temperature sensor (yes it exists!):

    hwCPUTemperature()

    sorry, stupid question maybe, but with my 328p based sensors hwCPUTemperature() is not automatically callable using just
    #include <MySensors.h> --> neither with 2.2.0 nor with 2.3.0

    Do I have to include /hal/architecture/AVR/MyHwAVR.h ?
    Cannot compile it, what path should I use in the #include statement? :white_frowning_face:

    Hardware

  • 💬 simple MySensors MultiSensor Board
    dirkcD dirkc

    @terxw all files from https://www.openhardware.io/view/562/simple-MySensors-MultiSensor-Board were sufficient, when I ordered my boards at allpcb. But you can create them with eagle on your own.

    OpenHardware.io mysensors htu21d ldr sensor

  • 💬 simple MySensors MultiSensor Board
    dirkcD dirkc

    I always suggest to use caps wherever you power the board, because it "levels" or "balances" the current so it has more "stability". The resistor connected to reset is always needed as "pull-up", without that, the processor will either reboot or be unstable.

    OpenHardware.io mysensors htu21d ldr sensor

  • What did you build today (Pictures) ?
    dirkcD dirkc

    @thucar what display do you use and where did you buy it? What library did you use?

    General Discussion

  • Multiple Relays + Motion sketch, fully customizable, optional timer, manual override
    dirkcD dirkc

    @ostoja look at this video with an explanation of this topic and how to handle the IDs
    https://forum.mysensors.org/post/26597

    Development

  • Multiple Relays + Motion sketch, fully customizable, optional timer, manual override
    dirkcD dirkc

    @ostoja said in Multiple Relays + Motion sketch, fully customizable, optional timer, manual override:

    // Present all sensors to controller
      for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {   
         present(i, S_TEMP);
      }
    
      // Register all sensors to gw (they will be created as child devices)
      for (int sensor = 1; sensor <= NUMBER_OF_RELAYS; sensor++) {
        present(sensor, S_BINARY, "Relay", ack);
      }
    

    With this two "for" loops you set present(n) multiple times. in the first for() you start with 0 until MAX_ATTACHED_DS18B20-1, in the second for() you start with 1 until NUMBER_OF_RELAYS-1, so this will assign the sensors with identical IDs as the relays.
    I have not checked the internal code of this method, but I would think that you should better user a different range in the second for() loop starting at least with MAX_ATTACHED_DS18B20+1.

    Development

  • MBSBootloader with different CSN/CE Pin problem
    dirkcD dirkc

    Thanks, @tekka, but unfortunately I am still using the wrong code. I tried every combination, but as I am not sure what am doing here, I doubt to make progress.

    set MOSI,SCLK,CE,CSN to OUTPUT -> SPI_DDR = _BV(SPI_MOSI) | _BV(SPI_SCLK) | _BV(CE_PIN) | _BV(CSN_PIN)
    set PB2 to OUTPUT -> | _BV(PB2)
    set MISO to INPUT -> | ~_BV(SPI_MISO)
    and set CSN to output -> CSN_DDR = _BV(CSN_PIN);

    The controller still doesn't recognize the node, so I cannot use OTA. But when I flash the sketch (with the CE and CSN pin defined to 8 and 9) with a programmer to an atmega328p with a standard bootloader it works, so my PCB seems ok.

    #elif defined(SPI_PINS_CSN9_CE8)
    	// set pin mode: MOSI,SCLK,CE,CSN = OUTPUT, MISO = INPUT
    	// PB2 is SS pin has to be defined as OUTPUT, else SPI goes to slave mode
    	SPI_DDR = _BV(SPI_MOSI) | _BV(SPI_SCLK) | _BV(CE_PIN)  | _BV(CSN_PIN) | _BV(PB2) | ~_BV(SPI_MISO);
    	// set CSN = output
    	CSN_DDR = _BV(CSN_PIN);
    #endif
    

    Looking to other bootloaders was no success, e.g. optiboot.

    Thanks in advance for any hint or better some sample code.

    Troubleshooting

  • MBSBootloader with different CSN/CE Pin problem
    dirkcD dirkc

    @tekka I also did some changes to assign the SPI pins CSN to pin 9 and CE to pin 8.

    So the code in the HW.hnow looks like this, but I am not sure how to change the initSPI() method:

    #elif defined(SPI_PINS_CSN9_CE8)
    	#define CSN_PORT	PORTB	// port for CSN
    	#define CSN_DDR		DDRB	// DDR for CSN
    	#define	CSN_PIN		PB1		// Arduino Pin 9 <-> Bit 1 of port B
    
    	#define CE_PORT		PORTB	// port for CE
    	#define CE_DDR		DDRB	// DDR for CE
    	#define	CE_PIN		PB0		// Arduino Pin  8 <-> Bit 0 of port B
    #endif
    
    
    static void initSPI(void) {
    	// Initialize the SPI pins: SCK, MOSI, CE, CSN as outputs, MISO as input
    	#if defined(SPI_PINS_CE9_CSN10)
    		// CSN_PIN (=PB2) is SS pin and set as output
    		SPI_DDR = _BV(SPI_MOSI) | _BV(SPI_SCLK) | _BV(CE_PIN) | _BV(CSN_PIN);
    	#elif defined(SPI_PINS_CSN7_CE8)
    		// PB2 is SS pin has to be defined as OUTPUT, else SPI goes to slave mode
    		SPI_DDR = _BV(SPI_MOSI) | _BV(SPI_SCLK) | _BV(CE_PIN) | _BV(PB2);	
    		CSN_DDR = _BV(CSN_PIN);
    	#elif defined(SPI_PINS_CSN9_CE8)
    		// set pin mode: MOSI,SCLK,CE,CSN = OUTPUT, MISO = INPUT
    		SPI_DDR = _BV(SPI_MOSI) | _BV(SPI_SCLK) | _BV(CE_PIN) | _BV(CSN_PIN) | ~_BV(SPI_MISO);
    		// set CSN = output
    		CSN_DDR = _BV(CSN_PIN);
    	#endif
    

    Is there any further code I have to change?

    Thanks in advance for any hint, I am not used to code on that bit level and AVR macros.

    Troubleshooting

  • 💬 MySensors Light Switch
    dirkcD dirkc

    What kind of Solid State Relay do you use? Can you switch 230V/4W LED bulbs with this Solid State Relay? I tried some "Songle" relays once and that causes the bulb to flicker all the time.

    OpenHardware.io solid state relay mysensors hlk-pm01 nrf24l01

  • Is there a logging function in the Raspberry Pi Gateway?
    dirkcD dirkc

    @strangeoptics I've created a simple python file just to connect to an ethernet MySensors gateway and monitor all output:
    https://github.com/dirkclemens/myssniffer.py/blob/master/myssniffer.py
    If you want to use it with a serial gateway you have to make some changes in the main() routine to grab data from the usb port instead the ethernet port.

    General Discussion

  • Adding a local RCSwitch to a serial gateway crashes it
    dirkcD dirkc

    @LastSamurai
    I did more or less the same, but two calls are different in my setting

    In presentation() I use this call, but that is not your problem
    present(i, S_BINARY, "Relais");

    I suggest to change the send() method like this, because you first have to select the relay with setSensor()
    send(msgRelay.setSensor(CHILD_ID_RELAY1+i).set((bool)bValue));

    Development

  • best approach to add MySensors Node to an existing smoke detector?
    dirkcD dirkc

    @user2684 good approach, I'll have to check my smoke detector, which is a German brand
    https://www.amazon.de/Merten-547019-ARGUS-Rauchmelder-polarweiß/dp/B000ONMOGQ
    Don't know if the schematic is available.

    Hardware

  • best approach to add MySensors Node to an existing smoke detector?
    dirkcD dirkc

    I have several smoke detectors around in my house, all driven by a 9 Volt block but without a radio. I think about the best approach to add a MySensors node to it. I do not have the schematics of the smoke detector.

    I want to use the 9 Volt block, so the node needs a voltage regulator.
    The node should draw as less current as possible, so connecting the buzzer from the smoke detector via an optocoupler to the MySensors node will need far too much current. What about a zener? What about a voltage divider (resistors) to reduce buzzer voltage to Arduino pin level?
    Any other idea? Thanks in advance

    Hardware

  • Need advice on choosing software
    dirkcD dirkc

    @iamtheghost if you are looking for a universal solution, openhab2 is worth a closer look. MyController is focusing on MySensors only, but for this scenario, I find it useful. Simple installation, easy to use.
    I've tried openhab 1.7 with my devices but it uses far too much resources on my raspberry 2. consider a platform with at least 2GB of ram.
    So I switched back to FHEM as this is the only solution supporting my old FS20/FHT devices. UI definitively needs some polish and I really don't like perl, but I still have these old devices. MySensors is fully supported in FHEM.

    Troubleshooting

  • Need advice on choosing software
    dirkcD dirkc

    @iamtheghost have you checked this: https://www.mysensors.org/controller
    What about this
    http://mycontroller.org/

    Troubleshooting

  • Windows GUI/Controller for MySensors
    dirkcD dirkc

    I have problems using the OTA feature with MYSController.

    1. "undefined firmware/type" reported.
      My setup:
    • ESP8266 Gateway 2.1.1
    • MYSController Version 1.0.0beta (build 3314)
    • atmega328p chip with own pcb, internal osc 8MHz, and MYSBootloaderV13pre.hex (taken from the same zip file as MYSController.exe)

    The log file in MYSController shows "undefined firmware/type" :
    alt text

    Where can I find the latest software (exe and boot loader)?

    1. the "Reload repo" toolbar button is always greyed, but the "firmware_config" is available, has all entries and the hex files are in the same directory.

    2. is there a more detailed description available for the columns of the "firmware_config" file?

    thanks in advance

    Controllers myscontroller mysbootloader

  • MyMessage with bool value from relay state to controller (fhem)?
    dirkcD dirkc

    @gohan I don't know. I also tried V_STATUS, doesn't work either ...

    edit: V_STATUS works, was a wrong configuration in FHEM

    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