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
  1. Home
  2. Development
  3. Sensebender Gateway (SAMD21)

Sensebender Gateway (SAMD21)

Scheduled Pinned Locked Moved Development
10 Posts 2 Posters 63 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pikim
    wrote on last edited by
    #1

    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?

    T 1 Reply Last reply
    0
    • P pikim

      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?

      T Offline
      T Offline
      TimO
      Hero Member
      wrote on last edited by
      #2

      @pikim I found no (quick) solution yet and I'm interested in that as well. :-)

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pikim
        wrote on last edited by
        #3

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

        T 1 Reply Last reply
        0
        • P pikim

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

          T Offline
          T Offline
          TimO
          Hero Member
          wrote on last edited by TimO
          #4

          @pikim Yes, I do have a sensebender gateway that i am planning to use for an energy Meter. I am currently struggling with the circuit but the sensebender is running fine (with the arduino IDE though).

          What did you copied where?

          P 1 Reply Last reply
          0
          • T TimO

            @pikim Yes, I do have a sensebender gateway that i am planning to use for an energy Meter. I am currently struggling with the circuit but the sensebender is running fine (with the arduino IDE though).

            What did you copied where?

            P Offline
            P Offline
            pikim
            wrote on last edited by
            #5

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

            T 1 Reply Last reply
            1
            • P pikim

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

              T Offline
              T Offline
              TimO
              Hero Member
              wrote on last edited by
              #6

              @pikim Wow, nice! Yes it is working just fine! Good work, thank you!

              P 1 Reply Last reply
              0
              • T TimO

                @pikim Wow, nice! Yes it is working just fine! Good work, thank you!

                P Offline
                P Offline
                pikim
                wrote on last edited by
                #7

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

                T 1 Reply Last reply
                0
                • P pikim

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

                  T Offline
                  T Offline
                  TimO
                  Hero Member
                  wrote on last edited by
                  #8

                  @pikim Yes, I have tested with a blink example to light up an build in LED and that just worked as expected.

                  P 1 Reply Last reply
                  0
                  • T TimO

                    @pikim Yes, I have tested with a blink example to light up an build in LED and that just worked as expected.

                    P Offline
                    P Offline
                    pikim
                    wrote on last edited by
                    #9

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

                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      pikim
                      wrote on last edited by
                      #10

                      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

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      8

                      Online

                      11.7k

                      Users

                      11.2k

                      Topics

                      113.0k

                      Posts


                      Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                      • Login

                      • Don't have an account? Register

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