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
P

pikim

@pikim
About
Posts
18
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

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

    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.

    Development

  • Sensebender Gateway (SAMD21)
    P pikim

    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

    Development

  • Sensebender Gateway (SAMD21)
    P pikim

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

    Development

  • Sensebender Gateway (SAMD21)
    P pikim

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

    Development

  • Sensebender Gateway (SAMD21)
    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.

    Development

  • Sensebender Gateway (SAMD21)
    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.

    Development

  • Sensebender Gateway (SAMD21)
    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?

    Development

  • RPi gateway options
    P pikim

    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.

    Development

  • RPi gateway options
    P pikim

    I thought the W5100 must have its own SPI bus.

    Development

  • RPi gateway options
    P pikim

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

    Development

  • RPi gateway options
    P pikim

    Thanks for pointing me to the Sensebender. It looks great, although I'd prefer some AVR, as they're easier to handle. The ATmega324PB would be perfect imo, as it offers 2 SPIs, 2 USARTs and 2 I2Cs. Unfortunately Arduino supports only one of each type - that makes things complicated again.

    I've already worked with STM32, so that wouldn't be a problem. But I always coded in plain C up to now and I'm new to C++ and Arduino. And although the Arduino stuff should make life easier, I find it more complicated at the moment, because it does many things in the background. I prefer to know exactly what is happening on the MCU, but unfortunately MySensors doesn't run without the Arduino dependencies. And I don't want to reinvent the whole protocol...

    And I'm afraid that the STM32 is not so well supported as the AVR or a SAMD21.

    Development

  • Something's cooking in the MySensors labs...
    P pikim

    @BearWithBeard
    Are you still running the multi version on an ATmega328P? What's your long term experience with it?

    Announcements

  • RPi gateway options
    P pikim

    @rejoe2 said in RPi gateway options:

    Gateway (there's a "multi-transceiver-option upcoming" somewhen in the future)

    @rejoe2
    Maybe you're right and it makes sense to separate things. Where can I find informations about that gateway? Which MCU it uses and how things are connected?

    https://www.openhardware.io/view/776/STM32-Ethernet-RS485-MySensors-Gate could also be used for a universal gateway, but it's nearly impossible to get the according MCU at the moment.

    Development

  • RPi gateway options
    P pikim

    Hi,

    I'm very new to MySensors and think that I already understand the sensor side a bit. But I have problems to find out what I need (to do) on the gateway/controller side.

    What I want to do is:

    • use a RPi 3B+ as controller, probably with FHEM
    • build some RS485 controllers to control my ventilation systems

    Currently I have no idea what to do regarding the gateway. I'd like to connect it directly to the Pi, without another Arduino or similar in between. I read https://www.mysensors.org/build/raspberry and https://github.com/mysensors/MySensors/blob/development/configure but am still unsure whether it's possible to just connect the RS485 directly to the Pi. Can someone clarify that, please? Or is it preferable to have a dedicated gateway?

    Development

  • Support CAN transceiver benefits
    P pikim

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

    Feature Requests

  • MySensors @ Raspberry Pi without gateway
    P pikim

    I'm new to MySensors and therefore this is likely a noob topic: I plan to run FHEM on a Raspberry Pi 3B+ and I want to build some custom RS485 sensors/actors. As the RPi also has a UART interface I could connect a RS485 driver directly to the RPi, couldn't I? Or do I need a gateway in any case?

    Hardware

  • Support CAN transceiver benefits
    P pikim

    Thanks for the link, but that is not what I meant. He's using a CAN controller - I only want to use a CAN transceiver. I think I'll just try to modify the library accordingly and perform some experiments. Is there some RX ISR that is being called when receiving a byte? I've never used any Arduino stuff, but always wrote my programs in plain C from scratch. So I have no idea where to search for it.

    Feature Requests

  • Support CAN transceiver benefits
    P pikim

    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?

    Feature Requests
  • Login

  • Don't have an account? Register

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