Navigation

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

    pikim

    @pikim

    3
    Reputation
    18
    Posts
    2
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    pikim Follow

    Best posts made by pikim

    • RE: Sensebender Gateway (SAMD21)

      @TimO said in Sensebender Gateway (SAMD21):

      Yes, I do have a sensebender gateway

      It's great to hear that. Given that VS Code with PlatformIO is already running:

      • install "Atmel SAM" from PlatformIO -> Home -> Platforms. Then you should have .platformio/packages/framework-arduino-samd/ in your users directory.
      • download https://github.com/mysensors/ArduinoBoards/blob/master/boards/mysensors-samd-1.0.6.tar.bz2 and unzip it
      • integrate the unzipped data from inside mysensors-samd-1.0.6 into the according folders in .platformio/packages/framework-arduino-samd/, that means
        • the content from mysensors-samd-1.0.6/bootloaders into .platformio/packages/framework-arduino-samd/bootloaders/
        • the content from mysensors-samd-1.0.6/driver into .platformio/packages/framework-arduino-samd/driver/
        • the content from mysensors-samd-1.0.6/variants into .platformio/packages/framework-arduino-samd/variants/
      • append the active part from mysensors-samd-1.0.6/boards.txt to .platformio/packages/framework-arduino-samd/boards.txt
      • create .platformio/platforms/atmelsam/boards/sensebender_gw.json. I took the mkrzero.json from that folder and adjusted it to the Sensebender. So the content of .platformio/platforms/atmelsam/boards/sensebender_gw.json is:
      {
        "build": {
          "arduino": {
              "ldscript": "flash_with_bootloader.ld"
          },
          "core": "arduino",
          "cpu": "cortex-m0plus",
          "extra_flags": "-D__SAMD21G18A__",
          "f_cpu": "48000000L",
          "hwids": [
            [
              "0x1209",
              "0x6949"
            ],
            [
              "0x1209",
              "0x6948"
            ]
          ],
          "mcu": "samd21g18a",
          "usb_product": "Sensebender Gateway",
          "variant": "mysensors_gw"
        },
        "debug": {
          "jlink_device": "ATSAMD21G18",
          "openocd_chipname": "at91samd21g18",
          "openocd_target": "at91samdXX",
          "svd_path": "ATSAMD21G18A.svd"
        },
        "frameworks": [
          "arduino"
        ],
        "name": "Sensebender Gateway",
        "upload": {
          "disable_flushing": true,
          "maximum_ram_size": 32768,
          "maximum_size": 262144,
          "native_usb": true,
          "offset_address": "0x2000",
          "protocol": "sam-ba",
          "protocols": [
            "sam-ba",
            "blackmagic",
            "jlink",
            "atmel-ice"
          ],
          "require_upload_port": true,
          "use_1200bps_touch": true,
          "wait_for_upload_port": true
        },
        "url": "https://www.arduino.cc/en/Main/ArduinoBoardMKRZero",
        "vendor": "Arduino"
      }
      

      It's not a perfect solution as it's integrated into the already existing Atmel SAM package, but it's enough for testing imo. I'l keep trying to figure out how to make a dedicated package for the Sensebender.

      It would be great if you could follow these steps and create a new project and select the sensebender as board. Please tell me whether it worked or not.

      posted in Development
      pikim
      pikim
    • RE: Support CAN transceiver benefits

      OK, thanks. I'll have a look at it.

      posted in Feature Requests
      pikim
      pikim
    • Support CAN transceiver benefits

      Hi everyone,

      I'm planning to build my first MySensors projects and I want to use CAN transceivers instead of RS485 drivers. They seem interesting to me as they offer some advantages (e.g. the lack of a DE pin, avoidance of DE stuck). Supporting another advantage would require some modification in the library and I wanted to share my thoughts and hear your opinions about that.

      CAN controllers compare each bit they send with the response they receive on the bus. If transmission and reception don't match they immediately stop sending and assume that another node is also trying to send at the same time. Of course, it is not possible to achieve this functionality on bit level using a UART interface, but in my opinion it should be possible to achieve it on byte level, at least.

      If the library compares every byte it just sent with the byte it received at the same time it should be possible to get some level of collision detection and therefore to reduce the number of collisions. One requirement would be to send a unique byte first, but afaik MySensors already does that by sending the last ID and the sender ID at the beginning. If sent and received IDs match the bus was free and transmission can continue. If the IDs don't match the bus is busy and sending must be stopped and delayed. The lower the ID the higher the priority.

      It would be great if MySensors could implement that functionality using some symbols to enable and disable it. What do you think?

      posted in Feature Requests
      pikim
      pikim

    Latest posts made by pikim

    • (SOLVED) Sensebender Gateway and HomeAssistant: where does the battery level come from?

      Hello,

      currently I'm working on a custom Sensebender Gateway. I adapted the variant files to my hardware and it works so far. It's an Ethernet Gateway and the integration into HomeAssistant also worked well. But in HA it always shows 0% battery level (regardless of the level at the pin) and I didn't find the source location where that comes from. Can anyone tell me where to find it?

      I would like to measure the supply and/or battery voltage and calculate some realistic battery level.

      EDIT:
      Something like

      sendBatteryLevel(91);
      

      solves the issue.

      posted in Development
      pikim
      pikim
    • RE: Sensebender Gateway (SAMD21)

      Just for completeness: the right way to do this is to add the json under ~/.platformio/boards and the other files as described in https://community.platformio.org/t/how-use-a-same-chip-but-with-different-environment/18082/4

      posted in Development
      pikim
      pikim
    • RE: Sensebender Gateway (SAMD21)

      @TimO
      Cool! Could you keep me informed if you tried a more sophisticated application, maybe with some NRF24, RFM69 or Ethernet communication, please?

      posted in Development
      pikim
      pikim
    • RE: Sensebender Gateway (SAMD21)

      @TimO
      Just for clarification: you can build an application and it works as desired?

      posted in Development
      pikim
      pikim
    • RE: Sensebender Gateway (SAMD21)

      @TimO said in Sensebender Gateway (SAMD21):

      Yes, I do have a sensebender gateway

      It's great to hear that. Given that VS Code with PlatformIO is already running:

      • install "Atmel SAM" from PlatformIO -> Home -> Platforms. Then you should have .platformio/packages/framework-arduino-samd/ in your users directory.
      • download https://github.com/mysensors/ArduinoBoards/blob/master/boards/mysensors-samd-1.0.6.tar.bz2 and unzip it
      • integrate the unzipped data from inside mysensors-samd-1.0.6 into the according folders in .platformio/packages/framework-arduino-samd/, that means
        • the content from mysensors-samd-1.0.6/bootloaders into .platformio/packages/framework-arduino-samd/bootloaders/
        • the content from mysensors-samd-1.0.6/driver into .platformio/packages/framework-arduino-samd/driver/
        • the content from mysensors-samd-1.0.6/variants into .platformio/packages/framework-arduino-samd/variants/
      • append the active part from mysensors-samd-1.0.6/boards.txt to .platformio/packages/framework-arduino-samd/boards.txt
      • create .platformio/platforms/atmelsam/boards/sensebender_gw.json. I took the mkrzero.json from that folder and adjusted it to the Sensebender. So the content of .platformio/platforms/atmelsam/boards/sensebender_gw.json is:
      {
        "build": {
          "arduino": {
              "ldscript": "flash_with_bootloader.ld"
          },
          "core": "arduino",
          "cpu": "cortex-m0plus",
          "extra_flags": "-D__SAMD21G18A__",
          "f_cpu": "48000000L",
          "hwids": [
            [
              "0x1209",
              "0x6949"
            ],
            [
              "0x1209",
              "0x6948"
            ]
          ],
          "mcu": "samd21g18a",
          "usb_product": "Sensebender Gateway",
          "variant": "mysensors_gw"
        },
        "debug": {
          "jlink_device": "ATSAMD21G18",
          "openocd_chipname": "at91samd21g18",
          "openocd_target": "at91samdXX",
          "svd_path": "ATSAMD21G18A.svd"
        },
        "frameworks": [
          "arduino"
        ],
        "name": "Sensebender Gateway",
        "upload": {
          "disable_flushing": true,
          "maximum_ram_size": 32768,
          "maximum_size": 262144,
          "native_usb": true,
          "offset_address": "0x2000",
          "protocol": "sam-ba",
          "protocols": [
            "sam-ba",
            "blackmagic",
            "jlink",
            "atmel-ice"
          ],
          "require_upload_port": true,
          "use_1200bps_touch": true,
          "wait_for_upload_port": true
        },
        "url": "https://www.arduino.cc/en/Main/ArduinoBoardMKRZero",
        "vendor": "Arduino"
      }
      

      It's not a perfect solution as it's integrated into the already existing Atmel SAM package, but it's enough for testing imo. I'l keep trying to figure out how to make a dedicated package for the Sensebender.

      It would be great if you could follow these steps and create a new project and select the sensebender as board. Please tell me whether it worked or not.

      posted in Development
      pikim
      pikim
    • RE: Sensebender Gateway (SAMD21)

      @TimO
      Do you have hardware available? In the meantime I found out which files have to be copied where. Now I can select the board and the build succeeds. But as I have no hardware yet, I can't try the result.

      posted in Development
      pikim
      pikim
    • Sensebender Gateway (SAMD21)

      Re: 💬 Sensebender Gateway

      I like the Sensebender Gateway approach, based on the SAMD21. Although I plan to build a micro gateway in a first step, I'd like to try to build the software for the SAMD21 version to gain some experience with it. But I'm using PlatformIO right now and I'm not sure how to integrate the board information there. I was now able to find it using the built-in search functionality. Does someone know I can make the board available in PlatformIO and can write some lines about the necessary steps, please?

      posted in Development
      pikim
      pikim
    • RE: RPi gateway options

      OK, now I understand what you meant. And I was talking about immediately building an all-in-one gateway with W5100, RS485, NRF24 and RFM69. That would require 2 SPIs and 2 USARTs. Taking that into account the ATmega324PB would be a perfect match. And, indeed, I wanted to build it step-by-step and only wire the according MCU pins to pinheads to extend it later.

      The big downside of the ATmega324PB is the 5V voltage level @ 16MHz and the limited memory. I compiled the sketch from the all-in-one gateway and came up with about 95% flash usage. So there's not much space left for the future. And I think 16MHz would make sense for the gateway and 8MHz could be a bit slow. 12MHz@5V would be in spec, but 12MHz is quite uncommon.

      posted in Development
      pikim
      pikim
    • RE: RPi gateway options

      I thought the W5100 must have its own SPI bus.

      posted in Development
      pikim
      pikim
    • RE: RPi gateway options

      @rejoe2 said in RPi gateway options:

      I'm not sure wheather this assumption is right. Where comes this info from?

      Ah cool, you're right: the second SPI is available as SPI1, using the MightyCore. Do you, coincidentally, know whether the hardware SPI can be passed to MySensors?

      posted in Development
      pikim
      pikim