ryan-brazeal-ufl / OpenPyLivox

Python3 driver for Livox lidar sensors
GNU General Public License v3.0
85 stars 44 forks source link

Connection issue with _heartbeat failure #27

Closed luc-girod closed 3 years ago

luc-girod commented 3 years ago

Hei,

So, I have a LIVOX Horizon connected to a Raspberry Pi 3B, and I am having the copied issue bellow. It worksfor a while but crashes after a while, and rebooting the pi just brings back to it. The way the LIVOX is deployed means I can't unplug the power supply as will anymore (we are working on making this possible in the future).

SN XXXXXX'd out, obviously.

Using computer IP address: 192.168.13.35

   *** Discovered a Livox sensor ***
           Type: Horizon
         Serial: XXXXXXXXXXXXXXXX04
          IP(s): 192.168.13.104 (ID: 1)

Attempting to auto-connect to the Livox Horizon with S/N: XXXXXXXXXXXXX04

Connected to the Livox Horizon at IP: 192.168.13.104 (ID: 1)
Not connected to Livox sensor at IP: 192.168.13.104
Not connected to Livox sensor at IP: 192.168.13.104
Traceback (most recent call last):
  File "/home/livoxpi/git/SnowyOwl/appV2/acquisition.py", line 99, in <module>
    IP_computer=config.get('acquisition', 'computer_IP'))
  File "/home/livoxpi/git/SnowyOwl/appV2/acquisition.py", line 38, in acquire_clouds
    sensor.lidarSpinUp()                # Data Acquisition
  File "/home/livoxpi/git/OpenPyLivox/openpylivox/openpylivox.py", line 2328, in lidarSpinUp
    states.append(self._heartbeat.work_state)
AttributeError: 'NoneType' object has no attribute 'work_state'

Edit for additional comment: As you can see, the output has 2 "Not connected to Livox sensor at IP: 192.168.13.104", the first one thrown by sensor.setExtrinsicToZero(), the second by sensor.lidarSpinUp(). So it's like the connection gets established, then immediately fail. Could it be that the LIVOX is in some form of power saving state? Can it be awoken?

ryan-brazeal-ufl commented 3 years ago

Hi Luc,

Apologies for the late reply. Are you still experiencing this issue? I'm happy to help but there are lots of 'moving parts' within the connection, heart beat, send, receive, communication approach used by the Livox sensors that can be potentially causing the issue. Probably easiest to troubleshoot in real-time as opposed to messaging back and forth.

Let me know, -Ryan

luc-girod commented 3 years ago

Hei Ryan,

The LIVOX is now attached 8m in the air on a big pole in the Norwegian mountains. We are still having this issue, and our workaround is to have the raspberry pie attached to it reboot every 30 minutes to reinitialize the connection. Brutal, but, for now, functional. Not sure when I'll have direct access to it again to do debug without the risk of braking the experiment...

Cheers!