Skip to content

Adafruit_Hue-Circuitpython_Requests - File "adafruit_requests.py", line 419, in json #125

Closed
@cn-schuh

Description

@cn-schuh

Hi, i am not sure this is the correct way.

Currently i am experiencing with the adafruit_hue Circuitpython lib

I am using a Adafruit Feather RP2040 with a AirLift FeatherWing – ESP32 WiFi Co-Processor. (optianally i did a test with an EdgeBadge and and a Airlift Breakout).
I tested Circuitpython 7.3.3 and 8.0.0 - Beta 6 and the controller should be compatible, i guess.

Following this guide:
https://learn.adafruit.com/pyportal-phi ... controller
or other available guides regarding Adafruit_Hue.

My code fails always with the same error:

Traceback (most recent call last):
File "code.py", line 49, in
File "/lib/adafruit_hue.py", line 109, in discover_bridge
File "/lib/adafruit_requests.py", line 419, in json
ValueError: syntax error in JSON

during executing of functions like
ip = my_bridge.discover_bridge()
or
my_bridge.get_groups()
and all other HUE functions.

The JSON file of my HUE Box is arround 30 KB. i guess it must be something related on the format. The JSON itself is valid.

To be sure the problem is not related on the Adafruit_HUE lib, I did another test, without Adafruit_HUE:

Usage of the test was the guide below:
https://learn.adafruit.com/adafruit-air ... et-connect

Result:
The first json cames from the guide above, the second and third JSON from my HUE bridge.

Fetching json from http://api.coindesk.com/v1/bpi/currentprice/USD.json

{'time': {'updated': 'Jan 11, 2023 08:28:00 UTC', 'updatedISO': '2023-01-11T08:28:00+00:00', 'updateduk': 'Jan 11, 2023 at 08:28 GMT'}, 'disclaimer': 'This data was produced from the CoinDesk BANNED Price Index (USD). Non-USD currency data converted using hourly conversion rate from openexchangerates.org', 'bpi': {'USD': {'code': 'USD', 'description': 'United States Dollar', 'rate_float': 17428.1, 'rate': '17,428.0921'}}}

Fetching json from http://192.168.178.26/api/-lxlSLEO1If8k ... ZdrJJNdU4/

Traceback (most recent call last):
File "code.py", line 71, in
File "adafruit_requests.py", line 419, in json
ValueError: syntax error in JSON

Fetching json from http://192.168.178.26/api/-lxlSLEO1If8k ... 4/lights/7

Traceback (most recent call last):
File "code.py", line 71, in
File "adafruit_requests.py", line 419, in json
ValueError: syntax error in JSON

Code done running.

As you can see, the error File "adafruit_requests.py", line 419, in json ValueError: syntax error in JSON is always identical.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions