Git Product home page Git Product logo

Comments (17)

undera avatar undera commented on July 28, 2024

Version 1.1.0 requires new version of hub firmware. Have you upgraded upgraded hub firmware? It is done via official mobile app.

from pylgbst.

undera avatar undera commented on July 28, 2024

If you did, please provide full log of startup.

from pylgbst.

Grumpy-Mike avatar Grumpy-Mike commented on July 28, 2024

Thank you for your swift response.
Yes it was after the firmware was updated to 2.0.00.0017. When I run the demo.py code from you, it appears it sees the Lego hub but does not connect. The attached file shows the printout that occurs constantly I hope there is enough of it to see what is happening.
demoLog.txt

from pylgbst.

undera avatar undera commented on July 28, 2024

Can you switch it into debug logging and send log with DEBUG messages?
Also, it is known problem that if you have renamed your device, it will fail to connect. To workaround it, please use MAC address to connect to it. See https://github.com/undera/pylgbst#bluetooth-connection-options

from pylgbst.

Grumpy-Mike avatar Grumpy-Mike commented on July 28, 2024

Thanks, I haven't changed any names. I can see you can switch it into debug mode by using
python -c "import logging; logging.basicConfig(level=logging.DEBUG);
import pylgbst; pylgbst.start_debug_server()"
But where do I enter this? I have tried the python console which gives me an syntax error and the terminal window which tells me it can't find stuff, both with and without sudo. Sorry to be a pain but I am more a hardware person than a systems level person.

from pylgbst.

undera avatar undera commented on July 28, 2024

https://github.com/undera/pylgbst/blob/master/examples/demo.py#L185
That line shows setting logging to INFO. You need DEBUG

from pylgbst.

Grumpy-Mike avatar Grumpy-Mike commented on July 28, 2024

Thanks. Attached is what I get. Note again this was all working before upgrading to V1.0 so I am assuming the dependencies I installed to get the older version working is sufficient for the new one. I see the permission denied so I will try again in sudo mode. This resulted in a no module named pylgbst.hub error message.
debugMode.txt

from pylgbst.

undera avatar undera commented on July 28, 2024

I got it. It's the problem of Hub name that I experienced in the past. Please install version 1.1.1, it should help to fix it.

from pylgbst.

Grumpy-Mike avatar Grumpy-Mike commented on July 28, 2024

Thanks upgraded. This is the result of the debug in the demo.py program. Unfortunately still nothing works. When I try the peripherals detected on Hub I get nothing. When I try including GattConnection I get:-
Traceback (most recent call last): File "/home/pi/MagPi/Boost/Part 3/Si-clops.py", line 9, in <module> from pylgbst.comms.cgatt import GattConnection File "/home/pi/.local/lib/python3.5/site-packages/pylgbst/comms/cgatt.py", line 6, in <module> import gatt ImportError: No module named 'gatt'
`
I had reinstalled pygat and it is now at version 4.0.5
File of the demo with debug attached
debugMode.txt

from pylgbst.

undera avatar undera commented on July 28, 2024

Sorry for late reply.
From your log, I see all devices are attached successfully, but the calls after that don't work. What I see is Python sends command to read device name and never gets reply from device.
I have no idea what causes Hub to not reply, from Python side everything looks correct. The fact you have device attach messages tells that Hub is generally functional and is able to communicate.

One thing you can try is instead of MoveHub() class try to use basic Hub() class. It won't have any simplifications like MoveHub, but will still let you interact with the devices via peripherals field.

Another way is to subclass MoveHub and override _report_status() method to remove attempt to print device name.

from pylgbst.

NikolayDA avatar NikolayDA commented on July 28, 2024

Thanks upgraded. This is the result of the debug in the demo.py program. Unfortunately still nothing works. When I try the peripherals detected on Hub I get nothing. When I try including GattConnection I get:-
Traceback (most recent call last): File "/home/pi/MagPi/Boost/Part 3/Si-clops.py", line 9, in <module> from pylgbst.comms.cgatt import GattConnection File "/home/pi/.local/lib/python3.5/site-packages/pylgbst/comms/cgatt.py", line 6, in <module> import gatt ImportError: No module named 'gatt'
`
I had reinstalled pygat and it is now at version 4.0.5
File of the demo with debug attached
debugMode.txt

Hello Grumpy-Mike and undera,

could you make any progress on this issue? I just started to try to run Mike Lego Boost Demo and ran into the same issue but I use different hardware (raspi zero w).

I'm have not much experience with python but if I can support the problem finding and solving please let me know.

br

Nikolay

from pylgbst.

undera avatar undera commented on July 28, 2024

I don't have access to RaspberryPI, sorry. The issue seem to need some deeper debugging and Python background.

from pylgbst.

NikolayDA avatar NikolayDA commented on July 28, 2024

Спасибо for you quick reply ;-)

I hope the community can help us out.

br nikolay

from pylgbst.

NikolayDA avatar NikolayDA commented on July 28, 2024

Hi undera,

just a quick update because I ran some test during the weekend. I was able to run your demo from pylgbst-master on my raspberry pi zero w and connect to my Lego Boost R2D2 and it started flashing the LED and dancing :-).

I'm using pylgbst 1.1.2 and an up-to-date raspi standard system on raspi zero w.

One thing was strange because I had to run the demo several times until it worked. The first time i connected it I could the Lego Boost Hub in the list of bluetooth devices but the demo crashed. Than I repeated the demo (this time without pressing the button on the lego boost). Result was that the list didn't contain the Boost anymore (so as expected). Than I ran the demo again and pressed the button this time. Result was a successfully running demo.

Thanks for providing this great lib!

from pylgbst.

undera avatar undera commented on July 28, 2024

Great

from pylgbst.

NikolayDA avatar NikolayDA commented on July 28, 2024

from pylgbst.

undera avatar undera commented on July 28, 2024

You would just instantiate two Hub classes, with two different connections to them. I guess using hub_mac parameter for connection is the key.

from pylgbst.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.