-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.1 Run the Demo] Cannot get SDL demo test to run successfully #252
Comments
@uznab16 can you include the full stack trace as text? Hard to see what's going on based on what you shared. |
Also, the public demo was offline for a bit. Maybe try again? |
---------------------------------------------------------------------------
Empty Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/self_driving_lab_demo/utils/observe.py](https://localhost:8080/#) in mqtt_observe_sensor_data(R, G, B, atime, astep, gain, pico_id, session_id, timeout, queue_timeout, client, username, password, hostname, port, tls, mongodb, extra_info)
105 try:
--> 106 sensor_data = sensor_data_queue.get(True, queue_timeout)
107 except Empty as e:
6 frames
[/usr/lib/python3.10/queue.py](https://localhost:8080/#) in get(self, block, timeout)
178 if remaining <= 0.0:
--> 179 raise Empty
180 self.not_empty.wait(remaining)
Empty:
The above exception was the direct cause of the following exception:
Empty Traceback (most recent call last)
[<ipython-input-15-973ce92dfadf>](https://localhost:8080/#) in <cell line: 31>()
29 )
30
---> 31 sdl = SelfDrivingLabDemoLight(
32 autoload=True, # perform target data experiment automatically
33 target_inputs=target_inputs, # if None, then defaults to random color using `target_seed` attribute
[/usr/local/lib/python3.10/dist-packages/self_driving_lab_demo/demos/light.py](https://localhost:8080/#) in __init__(self, random_rng, target_seed, target_inputs, rest_seconds, max_power, autoload, simulation, simulator, observe_sensor_data_fn, observe_sensor_data_kwargs)
158 >>> demo.evaluate(dict(R=50, G=150, B=250))
159 """
--> 160 super().__init__(
161 random_rng=random_rng,
162 target_seed=target_seed,
[/usr/local/lib/python3.10/dist-packages/self_driving_lab_demo/core.py](https://localhost:8080/#) in __init__(self, random_rng, target_seed, target_inputs, rest_seconds, max_power, autoload, simulation, simulator, observe_sensor_data_fn, observe_sensor_data_kwargs)
75 if autoload:
76 # must come after creating sensor attribute
---> 77 self.observe_target_results()
78
79 def observe_sensor_data(self, parameters):
[/usr/local/lib/python3.10/dist-packages/self_driving_lab_demo/core.py](https://localhost:8080/#) in observe_target_results(self)
107
108 def observe_target_results(self):
--> 109 self.target_results = self.observe_sensor_data(self.get_target_inputs())
110 if self.target_results is None or (
111 self.target_results.get("error", None) is not None
[/usr/local/lib/python3.10/dist-packages/self_driving_lab_demo/core.py](https://localhost:8080/#) in observe_sensor_data(self, parameters)
82 sleep(self.rest_seconds)
83
---> 84 return self.observe_sensor_data_fn(
85 **parameters, **self.observe_sensor_data_kwargs
86 )
[/usr/local/lib/python3.10/dist-packages/self_driving_lab_demo/utils/observe.py](https://localhost:8080/#) in mqtt_observe_sensor_data(R, G, B, atime, astep, gain, pico_id, session_id, timeout, queue_timeout, client, username, password, hostname, port, tls, mongodb, extra_info)
106 sensor_data = sensor_data_queue.get(True, queue_timeout)
107 except Empty as e:
--> 108 raise Empty(
109 f"Sensor data retrieval timed out ({queue_timeout} seconds)"
110 ) from e
Empty: Sensor data retrieval timed out (60 seconds) |
I am getting the same exact error |
Could you try one more time? We've been having a bunch of issues with certificates, but I think we have a fix for these. I just verified with https://huggingface.co/spaces/AccelerationConsortium/light-mixing, but maybe it's something specific to the notebook, in which case I'll reproduce. Can you also verify that it works correctly if you set Sorry for the trouble with this. Also, I've updated my notifications for this repo so hopefully I see these sooner. |
I see that the same error is occurring in the unit tests: https://github.com/sparks-baird/self-driving-lab-demo/actions/runs/11602495968/job/32307659409#step:5:1. Since the device appears to be online and accessible through the hugging face spaces app, I'll need to debug a bit more to figure out the source of the issue. |
I just ran parts of https://colab.research.google.com/github/sparks-baird/self-driving-lab-demo/blob/main/notebooks/4.2-paho-mqtt-colab-sdl-demo-test.ipynb#scrollTo=N88u4HkItJoj and it seems to be ok. Are you doing this with your own microcontroller, or are you trying to access the public test demo? |
@sgbaird I tried to run the microcontroller (I have my own) one more time and still got the same error. I then altered the code to make simulation=True (line 36) and the code compiled, BUT the LED light did not turn on or turn purple-ish. Leaving simulation=True and letting it compile, I ran the sdl.observe_sensor_data code and although it compiled, the LED did not turn on. Am I doing something wrong? |
@uznab16 maybe have a look at https://ac-microcourses.readthedocs.io/en/latest/courses/hello-world/1.1-running-the-demo.html. Can you copy your output from Thonny or wherever you're running the microcontroller script and paste it here? Are you trying this with the default public test broker or your own broker? Due to some recent changes, you'll also need to generate your own certificate (see instructions in linked microcourse page). |
@sgbaird This is the feedback I get after running main.py in Thonny: %Run -c $EDITOR_CONTENT MPY: soft reboot PICO_ID: ### Unencrypted PICO ID (keep private): ### However, a few minutes later, it will show this: Traceback (most recent call last): Retrying ntptime.settime(), still with pool.ntp.org Retrying ntptime.settime() with time.google.com PROBLEM IN THONNY'S BACK-END: Exception while handling 'Run' (ConnectionError: EOF). Process ended with exit code 1. MPY: soft reboot Type "help()" for more information. Process ended with exit code 3221225786. The actual pico_ID is listed. I just want to post it here. I'm sorry; I don't know what you mean by broker. I have the hivemq-com-chain.pem file from the microcourse included in the sdl_demo folder and I highlighted it as well in the "Upload to /" step. Just now, I have to create my own certificate by creating a HiveMQ account followed by a Serverless Cluster. Then I used the URL from the cluster as my host name to run the code in 7.2.1-hivemq-openssl-certificate.ipynb. I then uploaded the certificate to the Pico and reran main.py in Thonny. The output is generally the same as above. Sometimes I do have to press the "Stop" button. Other times, I get this: Traceback (most recent call last): MPY: soft reboot |
If you can reproducible get the following error Traceback (most recent call last):
File "", line 99, in
File "ntptime.py", line 1, in settime
File "ntptime.py", line 1, in time
OSError: [Errno 110] ETIMEDOUT and you've been able to connect to the WiFi as you showed, then it seems likely it's an issue with the WiFi you're using. Could you comment a bit on that setup? Are you able to test with any other WiFi's for debugging? |
I'm using my company WiFi which may present some security issues. I will try and Hot Spot my personal phone to see if it solves the issue. |
@sgbaird Using my phone's hot spot has solved the issue. I'm able to run the code and see the LED turn on. Thank you, Sterling! |
I'm trying to run the demo test with the LED colors (4.2-paho...), but I run into errors after installing the Python package. I'm not sure how to resolve it as I followed all of the instructions before this.
The text was updated successfully, but these errors were encountered: