Notifications
Clear all

FabScan requires internet connection to work or will hang after scan.  


Posts: 0
 Anonymous
Joined: 51 years ago

Hello, 

I modded a Ciclop using the following FabScan components:

  • FabScan Pi Hat 
  • FabScan Led Ring
  • FabScan Image v.0.8.2
  • Raspberry Pi 3B + Camera V2 (imx219)

The system is connected via Wifi to the network which is protected by a firewall also blocking any unauthorised outgoing traffic. This leads to the following situation:

  • FabScan Web GUI works
  • All elements can be controlled via GUI
  • Calibration seems to be successful
  • Scan is performed but before finishing it hangs for ever.

After spending some time with debugging the reason is that an exception is thrown preventing the system to start the FSScanner thread which is processing queued events such as(ON_IMAGE_PROCESSED). The result is that the system will never finish a scan and hangs with 100% CPU load.

Current Workaround:

  • allowing the system to connect to the internet

 

Error message in the log:

2020-01-02 10:15:06,102 - fabscan - CRITICAL - Fatal error: HTTPSConnectionPool(host='find.fabscan.org', port=443): Max retries exceeded with url: /register.php (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x63e57f90>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

2020-01-02 10:15:06,705 - fabscan.lib.util.FSUpdate - ERROR - <urlopen error [Errno -3] Temporary failure in name resolution>

 

 

 

 

Reply
3 Replies
mario
Posts: 479
Admin
(@mario)
Member
Joined: 2 years ago

Thank you for reporting this issue. Is your scanner connected to the internet?  Another workaround would be to change 

"discoverable": "True",

to

"discoverable": "False"

in the config. That prevents that the Fabscan tries to connect to the discovery service.

However i will start working on a fix.  Can you share the whole log please.

Reply
Posts: 0
 Anonymous
Joined: 51 years ago

Thanks for the suggestion. Unfortunately it does not change anything and the logs are identical - server is still registered.

Config (/etc/fabscanpi/default.config.json):

{

    "folders": {

        "www": "/usr/share/fabscanpi/", 

        "scans": "/home/pi/scans/"

    }, 

    "online_lookup_ip": "8.8.8.8", 

    "laser": {

        "color": "R (RGB)", 

        "numbers": 1, 

        "interleaved": "False"

    }, 

    "scanner_type": "laserscanner", 

    "calibration": {

        "weight_matrix": [], 

        "dist_camera_matrix": [], 

        "pattern": {

            "square_size": 13, 

            "rows": 6, 

            "columns": 11, 

            "origin_distance": 35

        }, 

        "camera_matrix": [

            [

                1291.535, 

                0.0, 

                573.002

            ], 

            [

                0.0, 

                1285.053, 

                834.647

            ], 

            [

                0.0, 

                0.0, 

                1.0

            ]

        ], 

        "distortion_vector": [

            -0.043, 

            3.657, 

            0.001, 

            0.001, 

            -18.986

        ], 

        "laser_planes": [

            {

                "deviation": 0.037992664155700254, 

                "distance": 104.81161825326163, 

                "normal": [

                    -0.9159280519304862, 

                    -0.04331144218548288, 

                    0.3989986499508954

                ]

            }

        ], 

        "platform_translation": [

            3.331764443124238, 

            101.06634043190357, 

            273.37572614599657

        ], 

        "platform_rotation": [

            [

                0.0, 

                0.9996990911347219, 

                0.024530128096098874

            ], 

            [

                0.017467386807132147, 

                0.024526385621802278, 

                -0.9995465706041218

            ], 

            [

                -0.9998474335608057, 

                0.00042847723588305915, 

                -0.01746213071558864

            ]

        ]

    }, 

    "keep_raw_images": "True", 

    "meshlab": {

        "path": "/usr/bin/"

    }, 

    "process_numbers": 3, 

    "turntable": {

        "steps": 6400, 

        "radius": 70, 

        "height": 155

    }, 

    "camera": {

        "rotate": "True", 

        "resolution": {

            "width": 1640, 

            "height": 1232

        }, 

        "vflip": "False", 

        "undistort": "False", 

        "preview_resolution": {

            "width": 800, 

            "height": 600

        }, 

        "hflip": "True", 

        "type": "PICAM"

    }, 

    "discoverable": "False", 

    "serial": {

        "plattform_type": "fabscanpi", 

        "baudrate": 57600, 

        "autoflash": "True", 

        "port": "/dev/ttyAMA0", 

        "flash_baudrate": 115200

    }, 

    "texture_illumination": 40

 

Log during startup with an active outgoing firewall blocking the fabscan from reaching public internet addresses (I added some more debug to fabscan.FSEvents and fabscan.worker.FSImageWorker  to verify that the event queue is processed):


2020-01-07 17:30:58,149 - fabscan.server.FSScanServer - INFO - FabScanPi-Server 0.8.2
2020-01-07 17:30:58,154 - fabscan.scanner.interfaces - DEBUG - Scanner Type is: laserscanner
2020-01-07 17:31:00,506 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - Port in Config found
2020-01-07 17:31:00,511 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - Latest available firmware version is: v.20190811
2020-01-07 17:31:02,833 - fabscan.lib.util.FSUtil - INFO - avrdude-original: Using autoreset DTR on GPIO Pin 7
2020-01-07 17:31:03,429 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - Trying to connect Arduino on port: /dev/ttyAMA0
2020-01-07 17:31:06,440 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - Installed firmware version: v.20190811
2020-01-07 17:31:06,441 - fabscan.scanner.laserscanner.driver.FSSerial - INFO - FabScanPi is connected to FabScanPi HAT or compatible on port: /dev/ttyAMA0
2020-01-07 17:31:08,449 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - Connection baudrate is: 57600
2020-01-07 17:31:08,450 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - Firmware flashing baudrate is: 115200
2020-01-07 17:31:08,451 - fabscan.scanner.laserscanner.FSHardwareController - DEBUG - Reset FabScanPi HAT...
2020-01-07 17:31:08,773 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M18;
2020-01-07 17:31:09,103 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - G07;
2020-01-07 17:31:09,605 - fabscan.scanner.laserscanner.driver.FSCamera - DEBUG - Cam Stream with Resolution (800, 600) stopped
2020-01-07 17:31:09,606 - fabscan.scanner.laserscanner.FSHardwareController - DEBUG - Reset FabScanPi HAT...
2020-01-07 17:31:09,933 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M18;
2020-01-07 17:31:10,263 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - G07;
2020-01-07 17:31:10,264 - fabscan.scanner.laserscanner.FSHardwareController - DEBUG - Hardware controller initialized...
2020-01-07 17:31:10,670 - fabscan.scanner.laserscanner.FSScanProcessor - INFO - Laser Scan Processor initilized...FSScanProcessor (urn:uuid:23569661-40d5-48c3-b9b6-8d38d8625a9f)
2020-01-07 17:31:10,671 - fabscan.server.FSWebServer - DEBUG - /usr/share/fabscanpi/
2020-01-07 17:31:10,727 - fabscan.FSScanner - INFO - Job scheduler started.
2020-01-07 17:31:10,728 - fabscan.FSScanner - INFO - Scanner initialized...
2020-01-07 17:31:10,729 - fabscan.FSScanner - INFO - Number of cpu cores: 4
2020-01-07 17:31:10,731 - fabscan.lib.util.FSDiscovery - INFO - Registering ip 192.168.178.235 to discovery service.
2020-01-07 17:31:11,612 - fabscan.server.services.websocket.FSWebSocketHandler - DEBUG - New client connected
2020-01-07 17:31:11,613 - fabscan.FSEvents - DEBUG - publish ON_CLIENT_CONNECTED
2020-01-07 17:31:11,618 - fabscan.FSEvents - DEBUG - handle ON_CLIENT_CONNECTED
2020-01-07 17:31:30,776 - fabscan - CRITICAL - Fatal error: HTTPSConnectionPool(host='find.fabscan.org', port=443): Max retries exceeded with url: /register.php (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x63e78fb0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
2020-01-07 17:31:31,651 - fabscan.lib.util.FSUpdate - ERROR - <urlopen error [Errno -3] Temporary failure in name resolution>
2020-01-07 17:31:31,654 - fabscan.FSScanner - DEBUG - Upgrade available: False 0.8.2
2020-01-07 17:31:31,655 - fabscan.FSEvents - DEBUG - publish ON_SOCKET_SEND
2020-01-07 17:31:31,656 - fabscan.FSEvents - DEBUG - handle ON_SOCKET_SEND
2020-01-07 17:31:31,660 - fabscan.scanner.laserscanner.FSScanProcessor - DEBUG - Checking Hardware connections
2020-01-07 17:35:50,734 - fabscan.scanner.laserscanner.FSScanProcessor - DEBUG - Checking Hardware connections
2020-01-07 17:38:51,957 - fabscan.server.services.websocket.FSWebSocketHandler - DEBUG - New client connected
2020-01-07 17:38:51,958 - fabscan.FSEvents - DEBUG - publish ON_CLIENT_CONNECTED
2020-01-07 17:38:51,958 - fabscan.FSEvents - DEBUG - handle ON_CLIENT_CONNECTED
2020-01-07 17:39:11,983 - fabscan.lib.util.FSUpdate - ERROR - <urlopen error [Errno -3] Temporary failure in name resolution>
2020-01-07 17:39:11,985 - fabscan.FSScanner - DEBUG - Upgrade available: False 0.8.2
2020-01-07 17:39:11,986 - fabscan.FSEvents - DEBUG - publish ON_SOCKET_SEND
2020-01-07 17:39:11,987 - fabscan.FSEvents - DEBUG - handle ON_SOCKET_SEND
2020-01-07 17:39:11,987 - fabscan.FSEvents - DEBUG - handle ON_SOCKET_SEND
2020-01-07 17:39:11,993 - fabscan.scanner.laserscanner.FSScanProcessor - DEBUG - Checking Hardware connections
2020-01-07 17:39:14,065 - fabscan.FSEvents - DEBUG - publish COMMAND
2020-01-07 17:39:14,066 - fabscan.FSEvents - DEBUG - handle COMMAND
2020-01-07 17:39:14,067 - fabscan.FSEvents - DEBUG - publish ON_SOCKET_BROADCAST
2020-01-07 17:39:14,068 - fabscan.FSEvents - DEBUG - handle ON_SOCKET_BROADCAST
2020-01-07 17:39:14,070 - fabscan.FSEvents - DEBUG - handle ON_SOCKET_BROADCAST
2020-01-07 17:39:24,783 - fabscan.scanner.laserscanner.driver.FSCamera - DEBUG - Cam Stream with Resolution (800, 600) started
2020-01-07 17:39:25,149 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M21;
2020-01-07 17:39:40,864 - fabscan.FSEvents - DEBUG - publish COMMAND
2020-01-07 17:39:40,884 - fabscan.FSEvents - DEBUG - handle COMMAND
2020-01-07 17:39:40,978 - fabscan.FSEvents - DEBUG - publish COMMAND
2020-01-07 17:39:40,988 - fabscan.FSEvents - DEBUG - handle COMMAND
2020-01-07 17:39:41,012 - fabscan.FSEvents - DEBUG - publish COMMAND
2020-01-07 17:39:41,016 - fabscan.FSEvents - DEBUG - handle COMMAND
2020-01-07 17:39:41,226 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M05 R0 G0 B0;
2020-01-07 17:39:41,322 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - >
2020-01-07 17:39:41,327 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M05 R0 G0 B0;
2020-01-07 17:39:41,791 - fabscan.FSEvents - DEBUG - publish COMMAND
2020-01-07 17:39:41,793 - fabscan.FSEvents - DEBUG - handle COMMAND
2020-01-07 17:39:41,821 - fabscan.FSEvents - DEBUG - publish COMMAND
2020-01-07 17:39:41,827 - fabscan.FSEvents - DEBUG - handle COMMAND
2020-01-07 17:39:41,852 - fabscan.FSEvents - DEBUG - publish COMMAND
2020-01-07 17:39:41,863 - fabscan.FSEvents - DEBUG - handle COMMAND
2020-01-07 17:39:41,892 - fabscan.FSEvents - DEBUG - publish COMMAND
2020-01-07 17:39:41,900 - fabscan.FSEvents - DEBUG - handle COMMAND
2020-01-07 17:39:41,934 - fabscan.FSEvents - DEBUG - publish COMMAND
2020-01-07 17:39:41,941 - fabscan.FSEvents - DEBUG - handle COMMAND
2020-01-07 17:39:54,183 - fabscan.FSEvents - DEBUG - publish COMMAND
2020-01-07 17:39:54,186 - fabscan.FSEvents - DEBUG - handle COMMAND
2020-01-07 17:39:54,188 - fabscan.FSScanner - INFO - Start command received...
2020-01-07 17:39:54,193 - fabscan.FSEvents - DEBUG - publish ON_SOCKET_BROADCAST
2020-01-07 17:39:54,208 - fabscan.FSEvents - DEBUG - handle ON_SOCKET_BROADCAST
2020-01-07 17:39:54,222 - fabscan.FSEvents - DEBUG - handle ON_SOCKET_BROADCAST
2020-01-07 17:39:54,546 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M18;
2020-01-07 17:39:54,871 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - G07;
2020-01-07 17:39:55,208 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M05 R0 G0 B0;
2020-01-07 17:39:55,541 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M22;
2020-01-07 17:39:56,071 - fabscan.scanner.laserscanner.driver.FSCamera - DEBUG - Cam Stream with Resolution (800, 600) stopped
2020-01-07 17:39:56,076 - fabscan.scanner.laserscanner.FSScanProcessor - INFO - Scan started
2020-01-07 17:39:56,631 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M17;
2020-01-07 17:39:58,302 - fabscan.scanner.laserscanner.driver.FSCamera - DEBUG - Cam Stream with Resolution (1640, 1232) started
2020-01-07 17:39:58,306 - fabscan.scanner.laserscanner.FSScanProcessor - INFO - Started object scan initialisation
2020-01-07 17:39:58,307 - fabscan.FSEvents - DEBUG - publish ON_SOCKET_BROADCAST
2020-01-07 17:39:58,308 - fabscan.FSEvents - DEBUG - handle ON_SOCKET_BROADCAST
2020-01-07 17:39:58,314 - fabscan.FSEvents - DEBUG - handle ON_SOCKET_BROADCAST
2020-01-07 17:39:58,651 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M21;
2020-01-07 17:39:59,181 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M05 R0 G0 B0;
2020-01-07 17:39:59,199 - fabscan.worker.FSImageWorker - INFO - Creating 3 image worker processes.
2020-01-07 17:39:59,267 - fabscan.worker.FSImageWorker - DEBUG - process 593 started
2020-01-07 17:39:59,316 - fabscan.worker.FSImageWorker - DEBUG - process 594 started
2020-01-07 17:39:59,363 - fabscan.worker.FSImageWorker - DEBUG - process 595 started
2020-01-07 17:40:00,162 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M22;
2020-01-07 17:40:00,174 - fabscan.scanner.laserscanner.FSScanProcessor - DEBUG - Laser Progress: 0 of 400 at laser position 1
2020-01-07 17:40:00,276 - fabscan.worker.FSImageWorker - DEBUG - empty
2020-01-07 17:40:00,324 - fabscan.worker.FSImageWorker - DEBUG - empty
2020-01-07 17:40:00,327 - fabscan.worker.FSImageWorker - DEBUG - empty
2020-01-07 17:40:00,420 - fabscan.worker.FSImageWorker - DEBUG - Progress 0 Resolution 400 angle 0.0
2020-01-07 17:40:00,569 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - G02 T64 F500;
2020-01-07 17:40:01,058 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M21;
2020-01-07 17:40:01,857 - fabscan.worker.FSImageWorker - DEBUG - found 932 points
2020-01-07 17:40:01,860 - fabscan.worker.FSImageWorker - DEBUG - send
2020-01-07 17:40:02,141 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M22;
2020-01-07 17:40:02,143 - fabscan.scanner.laserscanner.FSScanProcessor - DEBUG - Laser Progress: 1 of 400 at laser position 1
2020-01-07 17:40:02,256 - fabscan.worker.FSImageWorker - DEBUG - empty
2020-01-07 17:40:02,284 - fabscan.worker.FSImageWorker - DEBUG - empty
2020-01-07 17:40:02,310 - fabscan.worker.FSImageWorker - DEBUG - empty
2020-01-07 17:40:02,448 - fabscan.worker.FSImageWorker - DEBUG - Progress 1 Resolution 400 angle 0.9
2020-01-07 17:40:02,571 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - G02 T64 F500;
2020-01-07 17:40:03,040 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M21;
2020-01-07 17:40:03,760 - fabscan.worker.FSImageWorker - DEBUG - found 930 points
2020-01-07 17:40:03,762 - fabscan.worker.FSImageWorker - DEBUG - send
2020-01-07 17:40:04,102 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M22;
2020-01-07 17:40:04,103 - fabscan.scanner.laserscanner.FSScanProcessor - DEBUG - Laser Progress: 2 of 400 at laser position 1
2020-01-07 17:40:04,269 - fabscan.worker.FSImageWorker - DEBUG - empty
2020-01-07 17:40:04,274 - fabscan.worker.FSImageWorker - DEBUG - empty
2020-01-07 17:40:04,378 - fabscan.worker.FSImageWorker - DEBUG - Progress 2 Resolution 400 angle 1.8
2020-01-07 17:40:04,522 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - G02 T64 F500;
2020-01-07 17:40:04,996 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M21;
2020-01-07 17:40:05,659 - fabscan.worker.FSImageWorker - DEBUG - found 941 points
2020-01-07 17:40:05,661 - fabscan.worker.FSImageWorker - DEBUG - send
2020-01-07 17:40:06,082 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M22;
2020-01-07 17:40:06,084 - fabscan.scanner.laserscanner.FSScanProcessor - DEBUG - Laser Progress: 3 of 400 at laser position 1
2020-01-07 17:40:06,190 - fabscan.worker.FSImageWorker - DEBUG - empty
2020-01-07 17:40:06,216 - fabscan.worker.FSImageWorker - DEBUG - empty
2020-01-07 17:40:06,243 - fabscan.worker.FSImageWorker - DEBUG - empty
2020-01-07 17:40:06,334 - fabscan.worker.FSImageWorker - DEBUG - Progress 3 Resolution 400 angle 2.7
2020-01-07 17:40:06,520 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - G02 T64 F500;
2020-01-07 17:40:06,985 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M21;
2020-01-07 17:40:07,649 - fabscan.worker.FSImageWorker - DEBUG - found 936 points
2020-01-07 17:40:07,651 - fabscan.worker.FSImageWorker - DEBUG - send
2020-01-07 17:40:08,072 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M22;
2020-01-07 17:40:08,074 - fabscan.scanner.laserscanner.FSScanProcessor - DEBUG - Laser Progress: 4 of 400 at laser position 1
2020-01-07 17:40:08,182 - fabscan.worker.FSImageWorker - DEBUG - empty
2020-01-07 17:40:08,205 - fabscan.worker.FSImageWorker - DEBUG - empty
2020-01-07 17:40:08,234 - fabscan.worker.FSImageWorker - DEBUG - empty
2020-01-07 17:40:08,315 - fabscan.worker.FSImageWorker - DEBUG - Progress 4 Resolution 400 angle 3.6
2020-01-07 17:40:08,514 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - G02 T64 F500;
2020-01-07 17:40:08,980 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M21;
2020-01-07 17:40:09,732 - fabscan.worker.FSImageWorker - DEBUG - found 1037 points
2020-01-07 17:40:09,734 - fabscan.worker.FSImageWorker - DEBUG - send
2020-01-07 17:40:10,062 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M22;
2020-01-07 17:40:10,064 - fabscan.scanner.laserscanner.FSScanProcessor - DEBUG - Laser Progress: 5 of 400 at laser position 1
2020-01-07 17:40:10,314 - fabscan.worker.FSImageWorker - DEBUG - Progress 5 Resolution 400 angle 4.5
2020-01-07 17:40:10,501 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - G02 T64 F500;
2020-01-07 17:40:10,980 - fabscan.scanner.laserscanner.driver.FSSerial - DEBUG - M21;

After this everything looks normal except that the event queue is not processed:

Reply
mario
Posts: 479
Admin
(@mario)
Member
Joined: 2 years ago

I think i had a similar issue. But that was not related to the events. It was a serial bug. After sending the command to the firmware, the firmware will send an ack ( think it simply echos the command after it was executed, not sure without the code in front of me). The server waits until this command was echoed by the Firmware. And that is maybe the Problem. In my opinion the FSSerial.py part runs somehow in a deadlock while waiting for the firmware response of M21. 

Can you try to reproduce it and have a look if the last log output is a FSSerial one?

Reply
Share: