-
Notifications
You must be signed in to change notification settings - Fork 40
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
Multiple stations, walking time filter, metro hero api support, off hours configuration #8
base: main
Are you sure you want to change the base?
Conversation
Update to CircuitPython 7. Making api a proper class.
Make API a proper class
Updating to CircuitPython 7
Hello, thanks for these great additions. I might be running into a bug that I wanted to flag to you. I am pulling data from two stations with my walk times both set at zero, and everything runs smoothly, until the top-most train moves on past "ARR"--at that point, the trains go blank (only the LN / DEST / MIN headers remain), and then a few minutes later the screen will repopulate with trains. What could be causing this refresh gap? Perhaps relatedly, when I set my walk times to anything above zero (e.g., 2 and 5), no trains populate, and the screen only shows the red LN / DEST / MIN headers. I am using Adafruit 7.3.3. Thanks. |
Metro Hero Fix, Added off hours ability
For reference: the previous code attempted to do math on the arrival["Min"] values, but they can be strings (like "ARR" or "BRD"). So the "if arrival.isdigit()" check is required.
Hey smchrist2, I just pushed a change to fix your first issue. The previous code was trying to do math on strings like "ARR" 🙃 Let me know if the change works for you Your second issue, I'm not sure about. Can you tell me what station_codes and train_groups you're using in your config file? I can try and diagnose. I have noticed trains being absent in WMATAs API response until they're very close, but it seems to be station dependent |
Merged the additions by Scott Garcia, thanks Scott! Also fixed a bug found by smchrsit02. For reference: the previous code attempted to do math on the arrival["Min"] values, but they can be strings (like "ARR" or "BRD"). So the "if arrival.isdigit()" check is required.
Was encountering the following timeout error when getting the current time: Traceeback (most recent call last): File "code.py", line 72, in <module> File "code.py", line 42, in is_off_hours File "adafruit_esp32spi/adafruit_esp32spi_wifimanager.py", line 225, in get File "adafruit_requests.py", line 698, in get File "adafruit_requests.py", line 556, in request File "adafruit_requests.py", line 414, in _get_socket File "adafruit_esp32spi/adafruit_esp32spi_socket.py", line 43, in getaddrinfo File "adafruit_esp32spi/adafruit_esp32spi.py", line 608, in get_host_by_name File "adafruit_esp32spi/adafruit_esp32spi.py", line 325, in _send_command_get_response File "adafruit_esp32spi/adafruit_esp32spi.py", line 292, in _wait_response_cmd File "adafruit_esp32spi/adafruit_esp32spi.py", line 271, in _wait_spi_char RuntimeError: Timed out waiting for SPI char
Thanks, @erikrrodriguez, for your help. I tried the change that you pushed but now it appears that no trains are populating (just the LN / DEST / MIN header). Any sense of the issue? I double checked that I had all my WiFi an other inputs correct. Thanks again. |
Hmm, not off the top of my ahead. If your walking times are set too high, then any trains returned from the WMATA API call will be filtered out and the none will show on the board. The MetroHero API returns trains further into the future, but they are shutting down their API in July, so it's not a good long term solution. Do you know if the original code works (from https://github.com/metro-sign/dc-metro) instead of my forked code? If you tell me what you have set for your |
Requested by cjk314, initially implemented by ScottKekoaShay
Requested by cjk314, initially implemented by ScottKekoaShay
Hi @erikrrodriguez - I'm having some trouble as well. I also have the disappearing right after "ARR" issue -- I'm new to this platform and can't tell. I started this project in May, does that mean I'm likely using the version from after the above back-and-forth on this same issue? Also, instead of turning off the display at night, it goes to a pink and blue ADAFRUIT display with a flamingo and other things like that. Is this a known issue? Thank you! |
Hi @defrank1 sorry for the delayed response. I haven't pushed any updates since March, so you should be using the latest version. If you think you might have made changes to files other than config.py, try replacing them. For your first issue, if you tell me what values you have set for your Your second issue means the code is crashing. Can you tell me what you have set for your |
Thanks Erik. I really appreciate the reply. Here's what I have: Metro Station Code
And here's what I have for the Off Hours Config #############################
Thank you! |
First, you should edit your post to remove your Second, if that's what your config file looks like then you are indeed using an older version of the code. This chat thread we're in right now is not actually based on my latest repository. Go to https://github.com/erikrrodriguez/dc-metro to get the latest code. You'll also need to update your libraries to CircuitPython 8, because I think you might have 7 installed. Third, you don't need to dupe your stations like you are right now because you're showing the same information. It should look like
And when you update to the latest version of the code it should look like
Let me know if you still have issues after all that. |
Thanks so much Erik! I think everything is working! it's showing ARR and
BRD without any hiccups, and turning off (a minute late, but whatever) and
back on when directed. I really appreciate it!!
…On Sat, Jun 24, 2023 at 10:27 AM Erik Rodriguez ***@***.***> wrote:
First, you should edit your post to remove your aio_key, just in case
someone wants to steal it :)
Second, if that's what your config file looks like then you are indeed
using an older version of the code. This chat thread we're in right now is
not actually based on my latest repository.
Go to https://github.com/erikrrodriguez/dc-metro to get the latest code.
You'll also need to update your libraries to CircuitPython 8, because I
think you might have 7 installed.
Third, you don't need to dupe your stations like you are right now because
you're showing the same information. It should look like
'metro_station_codes': ['A03'],
# Metro Train Group
'train_groups': ['1'],
#Walking Distance Times, ignore trains arriving in less than this time
# [2, 12]
'walking_times': [0],
And when you update to the latest version of the code it should look like
# Metro Station Codes
'metro_station_codes': ['A03'],
# Metro Train Groups
'swap_train_groups': False,
'train_groups_1': ['1'],
'train_groups_2': ['1'],
# Walking Distance Times, ignore trains arriving in less than this time
# [2, 12]
'walking_times': [0],
Let me know if you still have issues after all that.
—
Reply to this email directly, view it on GitHub
<#8 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BABY3BLN3OL5WPBNC6KYDV3XM32O3ANCNFSM5L665NKQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Add changes
My fork based off of the terrific contributions of @erikrrodriguez . Changes include.
Added
Changed
lib.zip
files to CircuitPython 7