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. Feature Requests
  3. Support CAN transceiver benefits

Support CAN transceiver benefits

Scheduled Pinned Locked Moved Feature Requests
5 Posts 3 Posters 52 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

    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?

    mfalkviddM 1 Reply Last reply
    1
    • 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?

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #2

      Welcome to the forum @pikim

      https://github.com/mysensors/MySensors/pull/1488 was submitted earlier this year but has unfortunately not gotten any feedback.

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

        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.

        1 Reply Last reply
        0
        • rejoe2R Offline
          rejoe2R Offline
          rejoe2
          wrote on last edited by
          #4

          Might be wrong, but that kind of check seems to be what's called SOH. Most likely jumping in the code in https://github.com/mysensors/MySensors/blob/development/hal/transport/RS485/MyTransportRS485.cpp#L129 may be a good starting point.

          Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

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

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

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


            7

            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