Jaycar-Electronics / WiFi-Relay-Controller

Create an ESP8266 Website to control 8 relays
6 stars 4 forks source link

Which board is the Uno controller identified as? #2

Open jrggv opened 4 years ago

jrggv commented 4 years ago

I've tried working with two computers, multiple USB leads, and two of the XC4411 boards to get this project up and running. In every case, I have the same problem - the ESP controller accepts the upload quickly and easily, just as the instructions say. But I can't get the board to accept uploads of the arduino.ino sketch. I've tried selecting Arduino/Genuino Uno as the board... and Arduino Uno Wifi... and Arduino Uno Wifi Rev2. I know the connection and port settings are okay because the ESP sketch uploads. I've checked and re-checked the DIP switches, and tried a second board. The error message is always avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x3a

Jaycar-Electronics commented 4 years ago

let me know how you go with that;

jrggv commented 4 years ago

Done all of that repeatedly. After it didn't work with the first board , I guessed a faulty dip switch and swapped boards. No dice.

...I should add that I have tried LOTS of board types to see what happened, and with some of them (eg, basic Arduino), I get LED activity on the board to show transmission happening, and progress dots on the computer screen before it eventually crashes out. It's definitely not that the board and PC can't communicate, it's just that the board doesn't respond to Arduino/Genuino Uno or Arduino with Wifi as a board type. ...and, to anticipate the next suggestion - I'm running the latest revisions of everything. I suspect that may be my problem. If there is an earlier rev of the Uno board that works, can you tell me which one I should roll back to?

On Fri, 29 Nov. 2019, 1:26 pm Jaycar, notifications@github.com wrote:

  • set board type to UNO.
  • switch 3 & 4 ON, everything else off.
  • make sure they "click" into the on position.
  • disconnect and reconnect the board
  • check port in tools menu, does it show up? disconnect it, does it disappear?
  • upload.

let me know how you go with that;

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Jaycar-Electronics/WiFi-Relay-Controller/issues/2?email_source=notifications&email_token=AN4U3D42NQ3MEZKCRBA5VZTQWB4VLA5CNFSM4JSO4KJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFNWQJA#issuecomment-559638564, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN4U3D62AB67ROCYMRKHWA3QWB4VLANCNFSM4JSO4KJQ .

Jaycar-Electronics commented 4 years ago

I would say that it's not to do with the software versions. depending on what's been uploaded it might be a case of a faulty bootloader, which is the last thing I could possibly think of what it is, unless you want to send a photo of your dip switches.

I'll have to investigate some of the stock, but if you have a spare UNO board you can try this: https://www.arduino.cc/en/Tutorial/ArduinoISP

the chip is only a ATMEGA328P, so it should only really be considered a "uno" type of board. other board definitions don't suit it.

jrggv commented 4 years ago

I'm reluctant to assume anything is faulty, just because this is the second board that has behaved in the exact same way. So if it is a problem with the bootloader code, it's a batch problem. (Nothing I've done should have touched the bootloader, I haven't tried anything more interesting that uploading sketches). FWIW, here's evidence that the DIP switches are as you'd expect. One tiny bit of extra info - when trying to upload the sketch with the board type set to Arduino/Genuino Uno, I get one faint flash from the TX led each time the IDE tries to upload a sketch. Ten upload timeouts, ten brief flashes... when I flick the dip switches and upload the esp code the TX led glows steadily and the RX led flashes merrily. dip_switches I saw from your screen grabs that you were using version 1.8.9 of the IDE when you documented the project, whereas I had 1.8.10 - so I've tried rolling back (no effect), using versions 1.6.18, 1.6.23 and 1.8.1 of the board package (no effect) and changing the flow control options in the serial port (hardware, none, xon/xoff - no effect), and changing the baud rate on the port (changes the hex code of the response, but still not in sync).

Jaycar-Electronics commented 4 years ago

Well I just got one fresh out of stock and uploaded both this uno sketch and the example blink sketch just fine.

Can you go to File > Preferences and tick the "show verbose output during upload" option? I'll try to find out where the issue is. copy and paste all the red text inside of 3 back ticks:

``` paste code here ```

If the ESP code works fine, then you don't have driver issues, you can see the port. Usually the sync messages are to do with either the bootloader as an easy option, or something is getting the uno out of being able to talk to the programmer. You don't have anything connected to the uno while programming? 😕 🤔 🤔 🤔

mine, for comparison, when I upload blink sketch with verbose:

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Opt\arduino-1.8.9\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM49
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
         Hardware Version: 3
         Firmware Version: 4.4
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "C:\Users\dw06\AppData\Local\Temp\arduino_build_368190/Blink.ino.hex"
avrdude: writing flash (924 bytes):

Writing | ################################################## | 100% 0.16s

avrdude: 924 bytes of flash written
avrdude: verifying flash memory against C:\Users\dw06\AppData\Local\Temp\arduino_build_368190/Blink.ino.hex:
avrdude: load data flash data from input file C:\Users\dw06\AppData\Local\Temp\arduino_build_368190/Blink.ino.hex:
avrdude: input file C:\Users\dw06\AppData\Local\Temp\arduino_build_368190/Blink.ino.hex contains 924 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.12s

avrdude: verifying ...
avrdude: 924 bytes of flash verified

avrdude done.  Thank you.
jrggv commented 4 years ago

Here you go – I’ve tried it three times with two PCs and two different USB leads – you will see the output in each case is the same, except that the two PCs use different COM port numbers and the hex code at the end of the error is different.

I think the only things in common between the different attempts are the Uno board itself, and the DC power supply. So I tried doing it with the power supply disconnected, running purely off the OTG port, and got the exact same results.

…and I have no problem uploading the ESP sketch from either machine. All of which was exactly the same with the previous board I was trying.

I really appreciate your trying to help, and I’m sort-of-glad if your shelf stock doesn’t have this problem. I think I am going to have to try your suggestion of reloading the bootloader, just to eliminate one more variable.

Cheers,

Jeremy

82MKII commented 4 years ago

Hi - sorry to drag up an oldish thread, but I'm having exactly the same issues as Jeremy described above. I set dip switches 5,6,7 on, and am able to upload code into the ESP successfully. Hence, comms with the XC4411 are working. Then, set them back to 3,4 on (all others off), set the board type to 'Arduino Uno', and try and upload the Blink sketch (or any other sketch), and get the same 'programmer not working' error as above. Unfortunately I don't have another Arduino to play with. Should I take mine back to Jaycar and try swapping it over? Any help greatly appreciated! Regards Peter

jrggv commented 4 years ago

Just to chip in – I never did get either the first or second XC4411 working. Eventually I found a solution using a Pi… but I still have my second XC4411 sitting in a cupboard, and I will be very happy to drag it out and try anything you can suggest to get it going.

Cheers,

Jeremy

From: 82MKII notifications@github.com Sent: Sunday, May 31, 2020 12:11 AM To: Jaycar-Electronics/WiFi-Relay-Controller WiFi-Relay-Controller@noreply.github.com Cc: jrggv jeremy.gregson@gmail.com; Author author@noreply.github.com Subject: Re: [Jaycar-Electronics/WiFi-Relay-Controller] Which board is the Uno controller identified as? (#2)

Hi - sorry to drag up an oldish thread, but I'm having exactly the same issues as Jeremy described above. I set dip switches 5,6,7 on, and am able to upload code into the ESP successfully. Hence, comms with the XC4411 are working. Then, set them back to 3,4 on (all others off), set the board type to 'Arduino Uno', and try and upload the Blink sketch (or any other sketch), and get the same 'programmer not working' error as above. Unfortunately I don't have another Arduino to play with. Should I take mine back to Jaycar and try swapping it over? Any help greatly appreciated! Regards Peter

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Jaycar-Electronics/WiFi-Relay-Controller/issues/2#issuecomment-636336234 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AN4U3DZNZR4NPBOV422QFJLRUEHVRANCNFSM4JSO4KJQ .

82MKII commented 4 years ago

Thanks Jeremy. I'm hoping Jaycar may chime in here if they have any suggestions. Alternately, Diyode Magazine had promised to publish details for an Arduino ISP in the June issue, but it looks like it didn't make it in. I'll keep searching and post up anything useful I find. Regards Peter

Jaycar-Electronics commented 4 years ago

Not sure what the issue with the board is unfortunately. I've had the Arduino IDE fail on me too many times ( with geniune arduino ) for it to be a good predictor of a failure. It might work on the 9th try, who knows.

A quick and easy fix would be to just re-burn the arduino bootloader, If it definitely fixes the issue then we might've had some problems with stock, but it's a bit late to do something about that now.

We have an ISP programmer here: https://www.jaycar.com.au/isp-programmer-for-arduino-and-avr/p/XC4627 with a manual on how to program easily.

Email our tech store and I'll get them to send you both a programmer

82MKII commented 4 years ago

Thank you very much!! I have emailed the tech store my details and a link to this thread. Hopefully that solves the issue. Thanks again Peter