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. Hardware
  3. In wall light switch node - Custom PCB

In wall light switch node - Custom PCB

Scheduled Pinned Locked Moved Hardware
custompcbinwallnodelight switchswitch
245 Posts 15 Posters 132.7k Views 23 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.
  • S Offline
    S Offline
    Samuel235
    Hardware Contributor
    wrote on last edited by
    #134

    Now, the next two steps I'm interested in taking is to get this working with 2 switches (Software modification, should be simple) and then to have it report its remaining power every 30 minutes to allow me to set up notifications through openhab to alert me to change the batteries so I'm not left with no light switch.

    MySensors 2.1.1
    Controller - OpenHAB (Virtual Machine)
    Gateway - Arduino Mega MQTT Gateway W5100

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Samuel235
      Hardware Contributor
      wrote on last edited by Samuel235
      #135

      It would appear that I'm having a timing issue with uploading via the FTDI adapter. Would this be down to the speed of the uC effecting the RX and TX connections?

      MySensors 2.1.1
      Controller - OpenHAB (Virtual Machine)
      Gateway - Arduino Mega MQTT Gateway W5100

      m26872M 2 Replies Last reply
      0
      • S Samuel235

        It would appear that I'm having a timing issue with uploading via the FTDI adapter. Would this be down to the speed of the uC effecting the RX and TX connections?

        m26872M Offline
        m26872M Offline
        m26872
        Hardware Contributor
        wrote on last edited by
        #136
        This post is deleted!
        1 Reply Last reply
        0
        • S Samuel235

          It would appear that I'm having a timing issue with uploading via the FTDI adapter. Would this be down to the speed of the uC effecting the RX and TX connections?

          m26872M Offline
          m26872M Offline
          m26872
          Hardware Contributor
          wrote on last edited by
          #137

          @samuel235 Are you trying to upload with Ftdi serial to MYSbootloader? I think it's only for OTA uploads, if you read here.

          S 1 Reply Last reply
          0
          • m26872M m26872

            @samuel235 Are you trying to upload with Ftdi serial to MYSbootloader? I think it's only for OTA uploads, if you read here.

            S Offline
            S Offline
            Samuel235
            Hardware Contributor
            wrote on last edited by Samuel235
            #138

            @m26872 - Thank you for pointing this out to me. I'm unsure why I haven't stumbled across that thread/topic today of all days, been searching and reading about MYSBootloader all day >.<

            From personal experience, would you advise any other bootloader, I'm guessing you're going to tell me about the one you are using. Could you link any information for me to check out regarding your choice of bootloader?

            Am I correct in recalling you're using DualOptiBoot?
            Does DualOptiBoot need external memory/flash?

            MySensors 2.1.1
            Controller - OpenHAB (Virtual Machine)
            Gateway - Arduino Mega MQTT Gateway W5100

            m26872M 1 Reply Last reply
            0
            • S Samuel235

              @m26872 - Thank you for pointing this out to me. I'm unsure why I haven't stumbled across that thread/topic today of all days, been searching and reading about MYSBootloader all day >.<

              From personal experience, would you advise any other bootloader, I'm guessing you're going to tell me about the one you are using. Could you link any information for me to check out regarding your choice of bootloader?

              Am I correct in recalling you're using DualOptiBoot?
              Does DualOptiBoot need external memory/flash?

              m26872M Offline
              m26872M Offline
              m26872
              Hardware Contributor
              wrote on last edited by
              #139

              @samuel235 No, I use plain optiboot, but I couldn't find a suiteable precompiled one for you. DualOptiboot requires external flash as you say.
              It's been a while since I played with bootloaders, but I think normal 8MHz Arduino Pro Mini bootloader would work for you with internal clock as well. It's this [ATmegaBOOT_168_atmega328_pro_8MHz.hex ] and I can find it in my "C:\Program Files\Arduino\hardware\arduino\avr\bootloaders\atmega" -folder, should be about the same for you I think. Try fuse settings E2-DA-06 (Lo-Hi-Ex) and rest of the boards.txt-settings from ArduinoProMini 3.3V 8MHz.

              S 1 Reply Last reply
              0
              • m26872M m26872

                @samuel235 No, I use plain optiboot, but I couldn't find a suiteable precompiled one for you. DualOptiboot requires external flash as you say.
                It's been a while since I played with bootloaders, but I think normal 8MHz Arduino Pro Mini bootloader would work for you with internal clock as well. It's this [ATmegaBOOT_168_atmega328_pro_8MHz.hex ] and I can find it in my "C:\Program Files\Arduino\hardware\arduino\avr\bootloaders\atmega" -folder, should be about the same for you I think. Try fuse settings E2-DA-06 (Lo-Hi-Ex) and rest of the boards.txt-settings from ArduinoProMini 3.3V 8MHz.

                S Offline
                S Offline
                Samuel235
                Hardware Contributor
                wrote on last edited by
                #140

                @m26872 - Ahh the generic arduino bootloader... I will have a look into using that tomorrow. As the MYSController gets more feature rich and support i will use that setup, however i love OpenHAB way too much to switch over right now.

                MySensors 2.1.1
                Controller - OpenHAB (Virtual Machine)
                Gateway - Arduino Mega MQTT Gateway W5100

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  Samuel235
                  Hardware Contributor
                  wrote on last edited by
                  #141

                  @m26872 - I've just spent a few minutes looking through my boards.txt and i came across:

                  ######## Settings for 
                  
                  ATmega328 8MHz Internal clock
                  atmega328bb.name=ATmega328 on a breadboard (8MHz internal clock)
                  atmega328bb.upload.protocol=stk500
                  atmega328bb.upload.maximum_size=30720
                  atmega328bb.upload.speed=57600
                  atmega328bb.bootloader.low_fuses=0xE2
                  atmega328bb.bootloader.high_fuses=0xDA
                  atmega328bb.bootloader.extended_fuses=0x05
                  atmega328bb.bootloader.path=arduino:atmega
                  atmega328bb.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hex
                  atmega328bb.bootloader.unlock_bits=0x3F
                  atmega328bb.bootloader.lock_bits=0x0F
                  atmega328bb.build.mcu=atmega328p
                  atmega328bb.build.f_cpu=8000000L
                  atmega328bb.build.core=arduino:arduino
                  atmega328bb.build.variant=arduino:standard
                  

                  Then out of interest I thought I would look at the bootloader that you suggested, to see what difference there would be. Turns out I was actually looking at it without knowing. I have a feeling that if I change the fuse settings to those that i am using now with MYSBootloader, I will be set to go.

                  The High Fuse setting you provided enables 1024 words in the boot flash section, a couple of questions about this:

                  • Is this defining the size of the area needed for the bootloader section on the built in memory (So smaller this is set to, as long as the bootloader will fit, the more room I will have for a sketch)?
                  • How do i find out the 'word size' of the bootloader (if the first question is correct method) so I can determine if the 1024 is big enough? I would rather know how to work this out rather than just assuming that it is because it is specified as that as default.

                  I was going to leave my fuses where they were at (E2, D8, 06 as LO:HI:EX) but if I can change the boot size setting, that would allow a bigger room for my sketches = Win Win!

                  I'm still slightly confused as to not being able to burn my extended fuse. I have read somewhere (lost the page) about not being possible to burn an EX fuse on a ATmega328p, which i find very hard to believe.

                  MySensors 2.1.1
                  Controller - OpenHAB (Virtual Machine)
                  Gateway - Arduino Mega MQTT Gateway W5100

                  m26872M 1 Reply Last reply
                  0
                  • S Samuel235

                    @m26872 - I've just spent a few minutes looking through my boards.txt and i came across:

                    ######## Settings for 
                    
                    ATmega328 8MHz Internal clock
                    atmega328bb.name=ATmega328 on a breadboard (8MHz internal clock)
                    atmega328bb.upload.protocol=stk500
                    atmega328bb.upload.maximum_size=30720
                    atmega328bb.upload.speed=57600
                    atmega328bb.bootloader.low_fuses=0xE2
                    atmega328bb.bootloader.high_fuses=0xDA
                    atmega328bb.bootloader.extended_fuses=0x05
                    atmega328bb.bootloader.path=arduino:atmega
                    atmega328bb.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hex
                    atmega328bb.bootloader.unlock_bits=0x3F
                    atmega328bb.bootloader.lock_bits=0x0F
                    atmega328bb.build.mcu=atmega328p
                    atmega328bb.build.f_cpu=8000000L
                    atmega328bb.build.core=arduino:arduino
                    atmega328bb.build.variant=arduino:standard
                    

                    Then out of interest I thought I would look at the bootloader that you suggested, to see what difference there would be. Turns out I was actually looking at it without knowing. I have a feeling that if I change the fuse settings to those that i am using now with MYSBootloader, I will be set to go.

                    The High Fuse setting you provided enables 1024 words in the boot flash section, a couple of questions about this:

                    • Is this defining the size of the area needed for the bootloader section on the built in memory (So smaller this is set to, as long as the bootloader will fit, the more room I will have for a sketch)?
                    • How do i find out the 'word size' of the bootloader (if the first question is correct method) so I can determine if the 1024 is big enough? I would rather know how to work this out rather than just assuming that it is because it is specified as that as default.

                    I was going to leave my fuses where they were at (E2, D8, 06 as LO:HI:EX) but if I can change the boot size setting, that would allow a bigger room for my sketches = Win Win!

                    I'm still slightly confused as to not being able to burn my extended fuse. I have read somewhere (lost the page) about not being possible to burn an EX fuse on a ATmega328p, which i find very hard to believe.

                    m26872M Offline
                    m26872M Offline
                    m26872
                    Hardware Contributor
                    wrote on last edited by
                    #142

                    @samuel235 said:

                    • Is this defining the size of the area needed for the bootloader section on the built in memory (So smaller this is set to, as long as the bootloader will fit, the more room I will have for a sketch)?

                    Yes.

                    • How do i find out the 'word size' of the bootloader (if the first question is correct method) so I can determine if the 1024 is big enough? I would rather know how to work this out rather than just assuming that it is because it is specified as that as default.

                    I don't have the tool or knowledge for that. Should be doable by removing indices and count the bytes in hex-file. But for me it's not a big deal to just use the size settings recommended for a particular bootloader. And in this case it´s stock Arduino, so why question it.

                    I'm still slightly confused as to not being able to burn my extended fuse. I have read somewhere (lost the page) about not being possible to burn an EX fuse on a ATmega328p, which i find very hard to believe.

                    So the '0x06'-kind of notation didn't work either? Strange.

                    S 1 Reply Last reply
                    0
                    • m26872M m26872

                      @samuel235 said:

                      • Is this defining the size of the area needed for the bootloader section on the built in memory (So smaller this is set to, as long as the bootloader will fit, the more room I will have for a sketch)?

                      Yes.

                      • How do i find out the 'word size' of the bootloader (if the first question is correct method) so I can determine if the 1024 is big enough? I would rather know how to work this out rather than just assuming that it is because it is specified as that as default.

                      I don't have the tool or knowledge for that. Should be doable by removing indices and count the bytes in hex-file. But for me it's not a big deal to just use the size settings recommended for a particular bootloader. And in this case it´s stock Arduino, so why question it.

                      I'm still slightly confused as to not being able to burn my extended fuse. I have read somewhere (lost the page) about not being possible to burn an EX fuse on a ATmega328p, which i find very hard to believe.

                      So the '0x06'-kind of notation didn't work either? Strange.

                      S Offline
                      S Offline
                      Samuel235
                      Hardware Contributor
                      wrote on last edited by
                      #143

                      @m26872 said:

                      And in this case it´s stock Arduino, so why question it.

                      I'm not questioning it, I just wanted to learn how to do it for if i ever came across a need to modify a bootloader i would then know how to record its size for the fuse burning.

                      So the '0x06'-kind of notation didn't work either? Strange.

                      When i set the boards.txt file to read 0x06 it worked perfect, which insinuates that it couldn't burn the chosen BoD, even though the fuse calculator says to ignore the error of the extended fuse, it should burn it even though it gives the error. I'm interested in trying to burn the extended fuse in normal binary rather than hexa. But i doubt it would work anyway.

                      MySensors 2.1.1
                      Controller - OpenHAB (Virtual Machine)
                      Gateway - Arduino Mega MQTT Gateway W5100

                      m26872M 1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        Samuel235
                        Hardware Contributor
                        wrote on last edited by
                        #144

                        It has just clicked inside my busy mind that 0x06 in binary is the same as 0xFE in Hexa. How embarrassed am I now after many questions and hours thinking about the extended fuse value. I'm now assuming that it returns the error because it is already set at that fuse :flushed:

                        MySensors 2.1.1
                        Controller - OpenHAB (Virtual Machine)
                        Gateway - Arduino Mega MQTT Gateway W5100

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          Samuel235
                          Hardware Contributor
                          wrote on last edited by
                          #145

                          So, i have it working using the following board.txt config:

                          ######## Settings for 
                          
                          ATmega328 8MHz Internal clock Brown-out detection 1.8v
                          atmega328bb.name=ATmega328 on a breadboard (8MHz internal clock) BoD1.8
                          atmega328bb.upload.tool=avrdude
                          atmega328bb.upload.protocol=stk500
                          atmega328bb.upload.maximum_size=30720
                          atmega328bb.upload.speed=57600
                          atmega328bb.bootloader.tool=avrdude
                          atmega328bb.bootloader.low_fuses=0xE2
                          atmega328bb.bootloader.high_fuses=0xDA
                          atmega328bb.bootloader.extended_fuses=0x06
                          atmega328bb.bootloader.path=arduino:atmega
                          atmega328bb.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex
                          atmega328bb.bootloader.unlock_bits=0x3F
                          atmega328bb.bootloader.lock_bits=0x3F
                          atmega328bb.build.mcu=atmega328p
                          atmega328bb.build.f_cpu=8000000L
                          atmega328bb.build.core=arduino:arduino
                          atmega328bb.build.variant=arduino:standard
                          

                          However, no matter what I did I couldn't get it to upload via FTDI. I've tried looking at the Arduino Pro Mini settings in boards.txt to see what 'upload.tool' it uses, AVRDUDE, same as i specified. I also then went to the google docs for the boards.txt reference file, that advises everything i did too. I'm a little stumped. All that i can think of is that i have wired it incorrectly on the pcb. Whats your thoughts on this?

                          MySensors 2.1.1
                          Controller - OpenHAB (Virtual Machine)
                          Gateway - Arduino Mega MQTT Gateway W5100

                          1 Reply Last reply
                          0
                          • S Samuel235

                            @m26872 said:

                            And in this case it´s stock Arduino, so why question it.

                            I'm not questioning it, I just wanted to learn how to do it for if i ever came across a need to modify a bootloader i would then know how to record its size for the fuse burning.

                            So the '0x06'-kind of notation didn't work either? Strange.

                            When i set the boards.txt file to read 0x06 it worked perfect, which insinuates that it couldn't burn the chosen BoD, even though the fuse calculator says to ignore the error of the extended fuse, it should burn it even though it gives the error. I'm interested in trying to burn the extended fuse in normal binary rather than hexa. But i doubt it would work anyway.

                            m26872M Offline
                            m26872M Offline
                            m26872
                            Hardware Contributor
                            wrote on last edited by
                            #146

                            @samuel235 said:

                            I'm not questioning it,

                            I'm not saying you do, I just told how I think of it.

                            I'm interested in trying to burn the extended fuse in normal binary rather than hexa.

                            Why, when the result is exactly the same?
                            Also, I'm not familiar with from where the "binary or hexa" comes from? They're both hexadecimal notation as far as I can see.

                            1 Reply Last reply
                            0
                            • scalzS Offline
                              scalzS Offline
                              scalz
                              Hardware Contributor
                              wrote on last edited by scalz
                              #147

                              I'm not sure what is your problem with ftdi.maybe wirings...do you have cts to gnd, and of course dtr to dtr, only one vcc active...??? Maybe you should try to burn original arduino ide bootloader and then ftdi upload attempts. If it still doesn't work, it could be the wirings...
                              for hexa vs binary..in some case binary notation can be useful, but for fuses, I prefer hexa: shorter, no possibility of mistakes by missing/miscounting one "1" or "0" bit ;)

                              1 Reply Last reply
                              0
                              • S Offline
                                S Offline
                                Samuel235
                                Hardware Contributor
                                wrote on last edited by
                                #148

                                @m26872 - I wanted to try it because i'm sure i read somewhere that the ATmega328 can't accept Hexa as fuses. But i doubt that information is valid if i'm honest with you.

                                @scalz - I have dtr to dtr and cts linked to ground. I also only have one VCC pin (which obviously goes to VCC). I'll be perfectly honest with you; the boart.txt setting i posted above, i thought that was using the arduino .hex bootloader, please inform me if i'm in correct in that.

                                MySensors 2.1.1
                                Controller - OpenHAB (Virtual Machine)
                                Gateway - Arduino Mega MQTT Gateway W5100

                                1 Reply Last reply
                                0
                                • S Offline
                                  S Offline
                                  Samuel235
                                  Hardware Contributor
                                  wrote on last edited by
                                  #149

                                  This is the board layout, if you guys can see any issues with my FTDI connections/pinout please advice me that you do, I will get that sorted for revison 3 of the board. If i'm honest, I don't mind burning the sketches with the ISP programmer everytime, so I'm very tempted to remove the FTDI, allowing a smaller board still.
                                  0_1455731784013_Wiring.jpg

                                  MySensors 2.1.1
                                  Controller - OpenHAB (Virtual Machine)
                                  Gateway - Arduino Mega MQTT Gateway W5100

                                  m26872M 1 Reply Last reply
                                  0
                                  • S Samuel235

                                    This is the board layout, if you guys can see any issues with my FTDI connections/pinout please advice me that you do, I will get that sorted for revison 3 of the board. If i'm honest, I don't mind burning the sketches with the ISP programmer everytime, so I'm very tempted to remove the FTDI, allowing a smaller board still.
                                    0_1455731784013_Wiring.jpg

                                    m26872M Offline
                                    m26872M Offline
                                    m26872
                                    Hardware Contributor
                                    wrote on last edited by
                                    #150

                                    @samuel235 How do you debug through ISP ?
                                    Have you tested your FTDI USB-serial converter with ArduinoProMini or something?

                                    S 1 Reply Last reply
                                    0
                                    • m26872M m26872

                                      @samuel235 How do you debug through ISP ?
                                      Have you tested your FTDI USB-serial converter with ArduinoProMini or something?

                                      S Offline
                                      S Offline
                                      Samuel235
                                      Hardware Contributor
                                      wrote on last edited by
                                      #151

                                      @m26872 - I haven't tried it out with a arduino pro mini, because i don't have one. However, tomorrow, I will get a Arduino nano out and sort some testing of my FTDI converter on that. I'm hoping that works and its just a simple wiring issue on my board.

                                      From your statement of "How do you debug through ISP?" I'm guessing that it isn't possible too, or was that a genuine question? If its not possible then I will keep the FTDI connectors on the board.

                                      MySensors 2.1.1
                                      Controller - OpenHAB (Virtual Machine)
                                      Gateway - Arduino Mega MQTT Gateway W5100

                                      m26872M 1 Reply Last reply
                                      0
                                      • S Samuel235

                                        @m26872 - I haven't tried it out with a arduino pro mini, because i don't have one. However, tomorrow, I will get a Arduino nano out and sort some testing of my FTDI converter on that. I'm hoping that works and its just a simple wiring issue on my board.

                                        From your statement of "How do you debug through ISP?" I'm guessing that it isn't possible too, or was that a genuine question? If its not possible then I will keep the FTDI connectors on the board.

                                        m26872M Offline
                                        m26872M Offline
                                        m26872
                                        Hardware Contributor
                                        wrote on last edited by
                                        #152

                                        @samuel235
                                        I think you should get yourself a APM (ArduinoProMini) as a reference device. While waiting I think you could wire a DTR circuit to your Uno or Nano and see if you can get your FTDI to talk through rx/tx there.

                                        The "debug through ISP" is a genuine question. My guess is that it's possible if your bootloader, programmer and IDE support it.

                                        1 Reply Last reply
                                        0
                                        • sundberg84S Offline
                                          sundberg84S Offline
                                          sundberg84
                                          Hardware Contributor
                                          wrote on last edited by sundberg84
                                          #153

                                          Yea, we talked about this as well @m26872 the other night... and to make it easy I also suggest having the fdti connector - if your node is about other to use it (new members to mysensors) thats they easiest way to be able to debug.

                                          Its possible to debug through SPI, [1, 2 , 3] but requiers extra code in your sketch. With fdti you can just user serial.println();Also it looks like you need an second arduino acting with some code... to read and print on that second device serial.... have not read everything through... but its a bit of work it seems.

                                          Controller: Proxmox VM - Home Assistant
                                          MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
                                          MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
                                          RFLink GW - Arduino Mega + RFLink Shield, 433mhz

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


                                          14

                                          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