PiSupply / Flick

Resources for the Flick range of boards and cases
https://pisupp.ly/flick1
66 stars 26 forks source link

flicklib demo results in error. #46

Open edouin opened 5 years ago

edouin commented 5 years ago

I am getting this error when trying to run flick-demo. Can you suggest what to do?

I checked i2cdetect and it shows the device.

Also tried firmware update.

pi@raspberrypi:/usr/src $ flick-demo Traceback (most recent call last): File "/usr/local/bin/flick-demo", line 4, in import('pkg_resources').run_script('flicklib==0.0.1', 'flick-demo') File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 739, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1501, in run_script exec(script_code, namespace, namespace) File "/usr/local/lib/python2.7/dist-packages/flicklib-0.0.1-py2.7.egg/EGG-INFO/scripts/flick-demo", line 4, in import('pkg_resources').run_script('flicklib==0.0.1', 'flick-demo') File "build/bdist.linux-armv7l/egg/flicklib.py", line 480, in File "build/bdist.linux-armv7l/egg/flicklib.py", line 278, in _handle_firmware_info Exception: An invalid GestiIC Library was stored, or the last update failed Error in atexit._run_exitfuncs: Traceback (most recent call last): File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs func(*targs, *kargs) File "build/bdist.linux-armv7l/egg/flicklib.py", line 462, in _exit TypeError: 'NoneType' object is not callable Error in sys.exitfunc: Traceback (most recent call last): File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs func(targs, **kargs) File "build/bdist.linux-armv7l/egg/flicklib.py", line 462, in _exit TypeError: 'NoneType' object is not callable

tvoverbeek commented 5 years ago

@edouin The interesting line in the traceback is:

File "build/bdist.linux-armv7l/egg/flicklib.py", line 278, in _handle_firmware_info
Exception: An invalid GestiIC Library was stored, or the last update failed

When you look at flicklib.py (https://github.com/PiSupply/Flick/blob/master/flick/flicklib.py) it seems you were able to communicate with the Flick board, but it did not recognize the correct firmware. Note there are specific firmwares (different parameters) for each variant (https://github.com/PiSupply/Flick/tree/master/firmware).

Right now I do not have any suggestions, except to try to reload the correct firmware.

edouin commented 5 years ago

Indeed, flashing solved the GestiIC library error. But gesture data is still not registered by the flick-demo.py. I am using Flick Hat and it was working before. What can I do for troubleshooting this problem?

                         **** Flick Demo ****

┌────────────────────────────────────────────────────────────────────────┐ │ X Y Z : │ │ Flick : │ │ Airwheel : │ │ Touch : │ │ Tap : │ │ Doubletap : │ └────────────────────────────────────────────────────────────────────────┘

┌────────────────────────────────────────────────────────────────────────┐ │ Firmware valid: Yes │ │ Hardware Revison: 99.128 │ │ Params Start Addr: 0x7300 │ │ Library Loader Version: 19.100 │ │ Library Loader Platform: Hillstar │ │ Firmware Start Addr: 0x1000 │ │ Firmware Version: 1.3.14;p:HillstarV01;x: │ │ DSP: ID9000r2963;i:B;f:22500;nMsg;s:Rel_1_3_prer1784:NM; │ └────────────────────────────────────────────────────────────────────────┘

                           Control-C to exit
edouin commented 5 years ago

Update on the situation. C++ example ./flick_example is showing the readout. The problem seams to be in my Python code.

tvoverbeek commented 5 years ago

@edouin See my answer on Discord

edouin commented 5 years ago

Still no luck. But getting readout with this library https://github.com/open-electronics/GestIC

edouin commented 5 years ago

Ended up using direct I2c read write... ... bus.write_i2c_block_data(addr, 0x10,[0x00, 0x00, 0xA2, 0x85, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x7F, 0x00,0x00, 0x00]) ... data = bus.read_i2c_block_data(addr, 0x00, 26) #Read the sensor data payload ...

This way everything works fine.

ifitikhar-iffy commented 4 years ago

IMG_1874 I am having the same issue, i don't know how to solve, i've tried reinstalling the OS, i2cdetect is also good, i don't know how flashing solves the issue

BarteKornafel commented 2 years ago

Has anyone solved this problem?