I'm trying to talk to my nanoleaf over my ESP8266 board. I'm using micropython and the urequests library I installed using upip.install('urequests').
urequests.get works and I can parse the response from something like: https://jsonplaceholder.typicode.com/posts/1
However when I try to parse the response from my nanoleaf with reponse.text the call just stops. I'm testing it over the UART REPL and it just does nothing until I ctrl+c then I get a keyboard interrupt. Using normal python on my x86 and requests with the same line works.
I'm using:
response = urequests.get(url)
response.text
Curl returns this from the nanoleaf:
{"on":{"value":true},"brightness":{"value":76,"max":100,"min":0},"hue":{"value":28,"max":360,"min":0},"sat":{"value":66,"max":100,"min":0},"ct":{"value":2700,"max":6500,"min":1200},"colorMode":"effect"}
Is that a memory issue? I'm not even trying to get the json, just the text result.
Related
For the past few weeks, i have been trying to make a HTTP request on a SIMCOM7080. I'm controlling this module via AT Commands. Every path that i try, ends with an ERROR. Does anyone have experience on getting this module to talk with for example Thingspeak? The link that i have tried is this one:
https://prod-162.westeurope.logic.azure.com/workflows/48fcd3ff69634babaa31ef51f89e2051/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=_4eWTUWPLqk5evTp1014kcntXff4akjlFpQJZo_5dFc
The purpose for this is to eventually connect this to an arduino via a UART connection, and displaying data on an IoT device.
Thanks in advance!
Every path with AT commands ends in an error. I have looked up all the documentation given by the manufacturer but it ends with ERROR.
I'm using MPLab Harmony to program a custom board based on ATSAME51J20A microprocessor from microchip.
I didn't find any Arduino library that would enable me to use the two CAN bus available on this chip, so I started looking into MPLab.
I've used the code generator that created me functions to use CAN0 and CAN1.
The problem comes when I try to send CAN messages:
The initialization works well. Then I call "CAN1_MessageTransmitFifo(...)" which returns true (no error) but no message arrives at the other end point.
The only error I can get is when I debug the program and look at the data returned by CAN1_ErrorGet(), it returns 0x707 which seems to be the bits indicating "CAN_PSR_LEC_NC_Val: (CAN_PSR) No Change" and I have no clue what it means.
Note that I was able to successfully use the CAN1 by using the adafruit library CAN.h. So on this bus we can reject the possibility of a hardware problem.
Below you will find screenshots of my configuration:
The project graph
Pin diagram
In the configuration options section I also get these weird warnings (for CAN0 and CAN1). I've highlighted them.
Configuration options
Here is the code sending the CAN message (after initialization):
CAN_TX_BUFFER msg = {0};
msg.id = 0xAB;
msg.data[0] = 'H';
CAN1_MessageTransmitFifo(1, &msg);
I'm sure I'm sending and receiving at the same speed (500KB/s) and on the logic analyser I only get garbage on the CAN lines (lots of random spikes).
Am I missing something ?
If you have a solution that doesn't use MPLab but permits the use of the two CAN bus and the two I2C I'm very interested.
And if you know what could cause the issue, please let me know.
Thank you in advance.
I am trying to create an http server which will start sending responses as early as I receive the first chunk.
I get a voice sample and then I return something back for each chunk of the voice sample. I was able to do this and test it out with apache http client and it worked. But I can't seems to get curl working with this. I start sending 200 O.K as as soon as I recieve the first chunk and the response starting from then on. And at the end of the request chunk I send an end of response chunk .Why does this not work with curl but with java http client. I saw that curl is sending variable size chunks but this may not be the actual reason.
Please help.
I have a serial device with which I am trying to communicate. This device knows when a complete command has been sent when the command string is terminated with a "\r". Thus, a typical command string might be something like "COMMAND \r".
I'm having trouble configuring stty in such a way that the carriage return gets sent to the device. Currently, the device will not respond to any of my commands, so it's as if the input to the device is still "hanging."
I've written some simple C code where I bypass the terminal and there I can successfully elicit replies from the device, which is the reason why I think that the commands are not being properly terminated in the terminal. I've tried many different permutations of -+onlcr, +icanon, etc to no avail. The baudrate, parity, data bits, start and stop bits are all properly configured, as far as I can tell.
How can I debug this issue?
What is the platform (machine)? What is the OS?
Have you tried to flush the output with
fflush( FILE * FP );
Tried COMMAND\r\n ? What's the device?
Using VLC 1.1.4 on Ubuntu 10.04 I can get the GUI to stream from my capture card to an HTTP client (e.g. IE8) but when I try using a command line version of properties the stream is not coming across. I am not sure I am coding the command line correctly. I grabbed the properties from the GUI and wrote a command line that seems reasonable, and gives no apparent errors in the VLC log, but no stream. When I point my browser at the camera.asf file, Windows Media Player pops up but almost immediately shows error "reached the end of file".
Here's what I pull from the GUI:
:sout=#transcode{vcodec=WMV2,vb=800,scale=1,acodec=wma2,ab=128,channels=2,samplerate=44100}:http{dst=:8080/camera.asf} :no-sout-rtp-sap :no-sout-standard-sap :sout-keep
And here's what I am trying as a command line:
cvlc v4l2:///dev/video0 --v4l2-input 1 --sout "#transcode{vcodec=WMV2,vb=800,scale=1,acodec=wma2,ab=128,channels=2,samplerate=44100}:http{dst=:8080/camera.asf}" --no-sout-rtp-sap --no-sout-standard-sap --sout-keep
I tried to get help from the VLC forum, but no replies.
Any ideas?
Thanks.