Mario, I am incredibly frustrated with this damn thing. I have sunk a few hundred dollars into building a fabscan the last couple months. The first HAT didn't work, so I bought another thinking maybe I messed it up. But the results are the same. The Arduino in the HAT is not responding. I have tried your instructions to reflash it using an Uno, and that didn't work either. This thing is nothing but frustration and wasted money.
Logs are below. There is very little info because this is a fresh install. And no, I don't have the previous logs. Just look at everyone else's with this problem.
I can perform advanced troubleshooting. I have a two channel oscilloscope here, but I'm not going to waste any more of my time trying to make sense of this by going through the schematics. If you need any measurements to fix this, tell me. Otherwise, the whole thing may go in the trash.
pi@fabscanpi:~ $ sudo /etc/init.d/fabscanpi-server status
fabscanpi-server: running.
pi@fabscanpi:~ $ sudo systemctl status fabscanpi-server
● fabscanpi-server.service - LSB: Start and stop the fabscanpi-server daemon
Loaded: loaded (/etc/init.d/fabscanpi-server; generated)
Active: active (running) since Fri 2019-12-20 16:37:12 GMT; 10min ago
Docs: man:systemd-sysv-generator(8)
Process: 463 ExecStart=/etc/init.d/fabscanpi-server start (code=exited, status=0/SUCCESS)
Tasks: 10 (limit: 2077)
Memory: 185.3M
CGroup: /system.slice/fabscanpi-server.service
└─559 /usr/bin/python /usr/bin/fabscanpi-server --config=/etc/fabscanpi/default.config.json --s
Dec 20 16:37:37 fabscanpi sudo[687]: pam_unix(sudo:session): session closed for user root
Dec 20 16:37:37 fabscanpi sudo[719]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/avrdude
Dec 20 16:37:37 fabscanpi sudo[719]: pam_unix(sudo:session): session opened for user root by (uid=0)
Dec 20 16:37:37 fabscanpi sudo[725]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/strace
Dec 20 16:37:37 fabscanpi sudo[725]: pam_unix(sudo:session): session opened for user root by (uid=0)
Dec 20 16:37:37 fabscanpi sudo[734]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/avrdude
Dec 20 16:37:37 fabscanpi sudo[734]: pam_unix(sudo:session): session opened for user root by (uid=0)
Dec 20 16:37:38 fabscanpi sudo[734]: pam_unix(sudo:session): session closed for user root
Dec 20 16:37:39 fabscanpi sudo[725]: pam_unix(sudo:session): session closed for user root
Dec 20 16:37:39 fabscanpi sudo[719]: pam_unix(sudo:session): session closed for user root
pi@fabscanpi:~ $ cat /var/log/fabscanpi/fabscanpi.log
2019-12-20 16:37:33,021 - fabscan.server.FSScanServer - INFO - FabScanPi-Server 0.8.0+201911082051
2019-12-20 16:37:33,025 - fabscan.scanner.interfaces - DEBUG - Scanner Type is: laserscanner
2019-12-20 16:37:35,015 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - Port in Config found
2019-12-20 16:37:35,021 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - Latest available firmware version is: v.20190811
2019-12-20 16:37:37,326 - fabscan.lib.util.FSUtil - DEBUG - avrdude-original: Using autoreset DTR on GPIO Pin 7
2019-12-20 16:37:39,528 - fabscan.lib.util.FSUtil - DEBUG - avrdude-original: Using autoreset DTR on GPIO Pin 7
2019-12-20 16:37:40,074 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - Trying to connect Arduino on port: /dev/ttyAMA0
Update -
Now the AVR is completely bricked.
pi@fabscanpi:~ $ avrdude -c stk500v1 -P /dev/ttyACM0 -b 19200 -p m328p -e -U flash:w:bloader.hex:i -U lfuse:w:0xFF:m -U hfuse:w:0xD6:m -U efuse:w:0x05:m -U lock:w:0x0F:m
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x000000 (retrying)
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x000000 (retrying)
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.
pi@fabscanpi:~ $ avrdude -c stk500v1 -b 19200 -P /dev/ttyACM0 -p ATmega328P -v
avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/etc/avrdude.conf"
User configuration file is "/home/pi/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyACM0
Using Programmer : stk500v1
Overriding Baud Rate : 19200
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 : STK500
Description : Atmel STK500 Version 1.x firmware
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x000000 (retrying)
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x000000 (retrying)
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.
First of all I think the caption can be easily misunderstood. Yes there are some users having this problem. And I am still trying to reproduce this behavior on my FabScans. But tested a couple of fresh HATs and it worked, so it is hard to find the error when it does not occur. But you can be sure that it is in my interest to help all of you people who are having this problem.
There are different reasons why the HAT will show a behavior like this.
- 1. Cold solder joints ( I think not in your case
- A corrupted bootloader ( maybe your case )
- A FabScanPi software bug
What we need to do in your case is, that we have to fix your boot loader problem ( your second post).
avrdude -c stk500v1 -P /dev/ttyACM0 -b 19200 -p m328p -e -U flash:w:bloader.hex:i -U lfuse:w:0xFF:m -U hfuse:w:0xD6:m -U efuse:w:0x05:m -U lock:w:0x0F:m
But you should
- try to use port /dev/ttyAMA0
- baudrate 57600 or 115200. (better 57600) , of course 19200 maybe also works.
You wrote that you have more than one HAT. We should try one of the HATs where you are able to read the device signature. The we should try to flash the latest FabScanPi Firmware manually. I will capture a log of my running setup this evening, so you are able to see a sequence on how the scanner starts. I will also reflash a boot loader with my described method, just to prove again that the description is correct.
I am sure we will get this "damn thing" running. ?
Let me clarify. I posted about having issues with the bootloader not flashing two months ago, but my post was never answered. I also sent an email to you on a different subject with questions I had prior to putting money into this project. I didn't get a response and my partner in this build (another tech that needs a 3d scanner to improve his business) to proceed, so we went with just the info we could find here and the other fabscan resources. I can't find that other HAT right now. This unresponsive one is the only one I have on my workbench right now.
So I am a little angry that it isn't working. I should have said "same as some of these previous posts". I apologize for that.
I will see what I can do and get back to you. Thank you for responding.
I have an idea on what is going on. I think that the FabScanPi Software runs into a deadlock while it tries to install the firmware when the HAT is a new one with only the boot loader on it. That would explain why the FabScan works for people who made an update and why it does not run for people who started with a plain kit.
But Attention: it is not a good idea to change back to v.0.7.0 there was another serial connection bug which breaks the boot loader so that you need to reflash it.
I will test all this stuff this evening and give you feedback as soon as possible.
Hi everyone,
i had some time for testing. I flashed my HAT to get in an initial state. Afterwards i run into the same error. But i think i have also found a solution. Please try the following and give me your feedback:
First stop the FabScanPi-Server with:
sudo /etc/init.d/fabscanpi-server stop
Then check if the connection to the HAT works and the bootloader of the HAT is ok:
sudo avrdude-autoreset -p m328p -b 115200 -carduino -P/dev/ttyAMA0
A message like this is what we want:
avrdude-original: Using autoreset DTR on GPIO Pin 7
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: safemode: Fuses OK (E:00, H:00, L:00)
avrdude done. Thank you.
If it fails it returns something like this:
avrdude-original: Using autoreset DTR on GPIO Pin 7
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xbf
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xbf
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xbf
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xbf
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xbf
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xbf
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xbf
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xbf
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xbf
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xbf
avrdude done. Thank you.
This failure can be caused by one of the follwing reasons:
- Baudrate is not working, try to change it to 57600 instead of 115200. One of this values should work, if not check 2 and 3. Especially when you tried to use a previous version of the fabscanpi-server < 0.8.0 go to 3.
- Bad solder joints, double check your solder joints
- Corrupted Firmware. Try to reflash your firmware by following the guide.
If you are able to produce the first shown above. You can go further and change the serial section of the /etc/default.config.json by adding the parameter flash_baudrate to your baudrate which you used in the previous step.
"serial": {
"plattform_type": "fabscanpi",
"baudrate": 57600,
"autoflash": "True",
"flash_baudrate": 115200,
"port": "/dev/ttyAMA0"
}
After changing the config start the server again:
sudo /etc/init.d/fabscanpi-server start
Have a look into your fabscanpi.log. A successful startup sequence should look like this lines...
2019-12-27 13:11:08,926 - fabscan.server.FSScanServer - INFO - FabScanPi-Server 0.8.1-dev
2019-12-27 13:11:08,928 - fabscan.scanner.interfaces - DEBUG - Scanner Type is: laserscanner
2019-12-27 13:11:09,583 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - Port in Config found
2019-12-27 13:11:09,586 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - Latest available firmware version is: v.20190811
2019-12-27 13:11:11,807 - fabscan.lib.util.FSUtil - INFO - avrdude-original: Using autoreset DTR on GPIO Pin 7
2019-12-27 13:11:12,358 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - Trying to connect Arduino on port: /dev/ttyAMA0
2019-12-27 13:11:15,367 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - Installed firmware version: v.20190811
2019-12-27 13:11:15,368 - fabscan.scanner.laserscanner.driver.FSSerial - INFO - FabScanPi is connected to FabScanPi HAT or compatible on port: /dev/ttyAMA0
2019-12-27 13:11:17,376 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - Connection baudrate is: 57600
2019-12-27 13:11:17,376 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - Firmware flashing baudrate is: 115200
2019-12-27 13:11:17,377 - fabscan.scanner.laserscanner.FSHardwareController - DEBUG - Reset FabScanPi HAT...
2019-12-27 13:11:17,702 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M18;
2019-12-27 13:11:18,032 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - G07;
2019-12-27 13:11:18,533 - fabscan.scanner.laserscanner.driver.FSCamera - DEBUG - Cam Stream with Resolution (800, 600) stopped
2019-12-27 13:11:18,534 - fabscan.scanner.laserscanner.FSHardwareController - DEBUG - Reset FabScanPi HAT...
2019-12-27 13:11:18,862 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M18;
2019-12-27 13:11:19,192 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - G07;
2019-12-27 13:11:19,192 - fabscan.scanner.laserscanner.FSHardwareController - DEBUG - Hardware controller initialized...
2019-12-27 13:11:19,437 - fabscan.scanner.laserscanner.FSScanProcessor - INFO - Laser Scan Processor initilized...FSScanProcessor (urn:uuid:6e0684b0-e7fc-42c4-9e51-b189a7b227fd)
2019-12-27 13:11:19,438 - fabscan.server.FSWebServer - DEBUG - /usr/share/fabscanpi/
2019-12-27 13:11:19,468 - fabscan.FSScanner - INFO - Job scheduler started.
2019-12-27 13:11:19,468 - fabscan.FSScanner - INFO - Scanner initialized...
2019-12-27 13:11:19,469 - fabscan.FSScanner - INFO - Number of cpu cores: 4
2019-12-27 13:11:19,470 - fabscan.lib.util.FSDiscovery - INFO - Registering ip 192.168.1.123 to discovery service.
2019-12-27 13:11:19,569 - fabscan.server.services.websocket.FSWebSocketHandler - DEBUG - New client connected
2019-12-27 13:11:19,965 - fabscan.FSScanner - DEBUG - Upgrade available: False 0.8.1-dev
2019-12-27 13:11:19,968 - fabscan.scanner.laserscanner.FSScanProcessor - DEBUG - Checking Hardware connections
2019-12-27 13:11:20,207 - fabscan.lib.util.FSDiscovery - INFO - Successfully registered to find.fabscan.org
2019-12-27 13:11:20,343 - fabscan.FSScanner - INFO - Added discovery scheduling job.
I am just woking on a solution for an automatic baudrate detection...
I hope you had some peaceful Christmas days. I am sure we will still fix this issue this year.
- Mario
Ok. As next step we will try to flash the latest fabscan firmware manually:
sudo /etc/init.d/fabscanpi-server stop
sudo avrdude-autoreset -D -V -U flash:w:/usr/lib/python2.7/dist-packages/fabscan/firmware/fabscanpi_v.20190811.hex:i -b 115200 -carduino -pm328p -P/dev/ttyAMA0
sudo /etc/init.d/fabscanpi-server start
where you should set the baudrate to the one you discovered in the previous steps..
The flashing output should be something like:
avrdude-original: Using autoreset DTR on GPIO Pin 7
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "/usr/lib/python2.7/dist-packages/fabscan/firmware/fabscanpi_v.20190811.hex"
avrdude: writing flash (12480 bytes):
Writing | ################################################## | 100% 1.68s
avrdude: 12480 bytes of flash written
avrdude: safemode: Fuses OK (E:00, H:00, L:00)
avrdude done. Thank you.
There is also a bug report on GitHub for this issue.
https://github.com/mariolukas/FabScanPi-Server/issues/139
I am just trying to find out if my fix works for all of you.
Same issue and I am getting:
avrdude: ser_open(): can't open device "/dev/ttyAMA0/firmware/fabscanpi_v.20190811.hex:i": Not a directory
avrdude done. Thank you.
Raspberry Pi 3 B new install.
When powering up get green light on LED ring on one LED. That is all. Have rechecked solder joints and will do so again. I am a UK full license amateur radio operator so I do know how to solder (but also know how easy it is to have a connection that is just not full on an I/O board).
Other then that it is moving forward.
Additional information on issues as follows:
pi@fabscanpi:~ $ sudo /etc/init.d/fabscanpi-server stop
No process in pidfile '/tmp/fabscanpi-server.pid' found running; none killed.
fabscanpi-server stopped.
pi@fabscanpi:~ $ sudo avrdude-autoreset -D -V -U flash:w:/usr/lib/python2.7/dist-packages/fabscan/firmware/fabscanpi_v.20190811.hex:i -b 115200 -carduino -pm328p -P/dev/ttyAMA0/firmware/fabscanpi_v.20190811.hex:i -b 115200 -carduino -pm328 avrdude-original: Using autoreset DTR on GPIO Pin 7
avrdude-original: Using autoreset DTR on GPIO Pin 7
avrdude: ser_open(): can't open device "/dev/ttyAMA0/firmware/fabscanpi_v.20190811.hex:i": Not a directory
avrdude done. Thank you.
Hope this additional information helps
pi@fabscanpi:~ $ sudo avrdude-autoreset -D -V -U flash:w:/usr/lib/python2.7/dist-packages/fabscan/firmware/fabscanpi_v.20190811.hex:i -b 115200 -carduino -pm328p -P/dev/ttyAMA0/firmware/fabscanpi_v.20190811.hex:i -b 115200 -carduino -pm328 avrdude-original: Using autoreset DTR on GPIO Pin 7
avrdude-original: Using autoreset DTR on GPIO Pin 7
I think you accidentally pasted the command twice. The correct command should be:
sudo avrdude-autoreset -D -V -U flash:w:/usr/lib/python2.7/dist-packages/fabscan/firmware/fabscanpi_v.20190811.hex:i -b 115200 -carduino -pm328p -P/dev/ttyAMA0
Try also the following, just to be sure that the connection to the HAT works:
sudo avrdude-autoreset -p m328p -b 115200 -carduino -P/dev/ttyAMA0
This should return something like:
avrdude-original: Using autoreset DTR on GPIO Pin 7
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: safemode: Fuses OK (E:00, H:00, L:00)
avrdude done. Thank you.
If you don't get this output try to use -b 57600 instead. Have you already tried a Software version below 0.8.0 ?
pi@fabscanpi:~ $ sudo service fabscanpi restart
This is not supported yet. Due systemd is not configured for the fabscanpi-server. You need to restart it the old way. Using
sudo /etc/init.d/fabscanpi-server restart
Having issues with getting an older image of FabScanPi
It is not a good idea to use an older version.
Looks like I improperly modified the json file and that was part of the issue. Was able to go back and get the 3200 dealt with and the 2 lasers as well. So right now calibrating. Is it normal for the time to keep increasing and temp to get a bit warm on the Pi 3 B??
keep increasing and temp to get a bit warm on the Pi 3 B??
Yes. That is quite normal. The Pi is running on 3 cores. You can prevent by installing a fan. Have a look at the Blog post for the 0.8.0 release.
I will close this thread now, because this topic is solved. If you have further issues please open a new topic.