Wolf F.K. in Discussions
上次活动时间: 2021-7-12

Hello to each other, I'm new here and wanted to test how it works with the transfer of data. To do this, I registered with ThingSpeak. I entered the API code in a Python script (see screenshot). Unfortunately, I always get the message: Response 400. When I enter the web address directly in the browser, I get a "0" back. I can't see an error entering the API key. Can you help me? I use a Raspberry 4B with the PIR sensor HC-SR501. The program will later run on a Raspberry Zero. Have a nice weekend everyone. Response 400, test how it works with the transfer One thing to check is to be sure you are using the channel API key and not your user API key. Also you can check the format of the API call in your browser window. See the API keys tab of your channel view for the suggested format. Danke für die schnelle Antwort. Ich habe einfach nochmal einen neuen API Schlüssel erzeugt und diesen per Drag and Trop eingegeben. Danach hat es funktioniert. Grüße aus Ulm/ Baden-Württemberg I'd also recommend removing the extra spaces in your 'requests.get' statement. Specifically, the spaces in this snippet 'api_key = SOMETHING & field1 = SOMEVALUE' should be replaced with 'api_key=SOMETHING&field1=SOMEVALUE'. The spaces get encoded as %20 (ascii character for spaces) and could be the reason you're seeing the 400 response. raspberry pir hc-sr501 python

关于 ThingSpeak

The community for students, researchers, and engineers looking to use MATLAB, Simulink, and ThingSpeak for Internet of Things applications. You can find the latest ThingSpeak news, tutorials to jump-start your next IoT project, and a forum to engage in a discussion on your latest cloud-based project. You can see answers to problems other users have solved and share how you solved a problem.