While setting up our PyPortal with this project for Electioncal US, you might run into a bit of trouble. Nothing to worry, all should be easy to solve.

Problems with the WiFi

If something is wrong with the WiFi connection, one way to recognize this problem is by connecting to the REPL Serial Console, where you might find messages like:

Connecting to AP my-access-point
Could not connect to internet ('Failed to connect to ssid', b'my-access-point')
Retrying in 3 seconds...

Here are some things you might look at to solve this:

  • Checking the name of the access point and it's password on the secrets.py file
  • Getting closer to the access point if it is far away

Problems setting up the county/state

If the JSON data cannot be found, you will see an error such as:

Error loading JSON data: Please check the configuration of county and state, in code.py

Traceback (most recent call last):

File "code.py", line 60, in

File "code.py", line 57, in

File "electioncal_graphics.py", line 76, in load_data

File "electioncal_graphics.py", line 72, in load_data

ValueError: syntax error in JSON

If this happens:

  • Check the spelling of the state and county
  • If the name of your state or county has a space, replace it with an underscore _
  • Remember to lowercase both names

PyPortal library on other devices

The PyPortal is a wonderful device, but it is not the only device that has a screen, such as the larger and smaller versions of the PyPortal such as the PyPortal Titano and the PyPortal Pynt.

Everything in the code should work well, but the laying of the text and background might be a bit off. Nothing to worry here.

Make gradual changes to electioncal_graphics.py in the __init__ section, where x and y are defined for all of the displayed objects.

This guide was first published on Jul 07, 2020. It was last updated on Nov 28, 2023.

This page (Troubleshooting) was last updated on Jul 05, 2020.

Text editor powered by tinymce.