Navigation

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

    dirkc

    @dirkc

    2
    Reputation
    22
    Posts
    558
    Profile views
    0
    Followers
    1
    Following
    Joined Last Online
    Location Germany

    dirkc Follow

    Best posts made by dirkc

    • RE: Need advice on choosing software

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

      posted in Troubleshooting
      dirkc
      dirkc
    • RE: Is there a logging function in the Raspberry Pi Gateway?

      @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.

      posted in General Discussion
      dirkc
      dirkc

    Latest posts made by dirkc

    • RE: bootloaders

      @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

      posted in General Discussion
      dirkc
      dirkc
    • RE: Atmega328 internal temperature sensor (yes it exists!)

      @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? ☹

      posted in Hardware
      dirkc
      dirkc
    • RE: 💬 simple MySensors MultiSensor Board

      @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.

      posted in OpenHardware.io
      dirkc
      dirkc
    • RE: 💬 simple MySensors MultiSensor Board

      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.

      posted in OpenHardware.io
      dirkc
      dirkc
    • RE: What did you build today (Pictures) ?

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

      posted in General Discussion
      dirkc
      dirkc
    • RE: Multiple Relays + Motion sketch, fully customizable, optional timer, manual override

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

      posted in Development
      dirkc
      dirkc
    • RE: Multiple Relays + Motion sketch, fully customizable, optional timer, manual override

      @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.

      posted in Development
      dirkc
      dirkc
    • RE: MBSBootloader with different CSN/CE Pin problem

      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.

      posted in Troubleshooting
      dirkc
      dirkc
    • RE: MBSBootloader with different CSN/CE Pin problem

      @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.

      posted in Troubleshooting
      dirkc
      dirkc
    • RE: 💬 MySensors Light Switch

      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.

      posted in OpenHardware.io
      dirkc
      dirkc