Skip to content
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

add try/except to cheerlights demo #13

Merged
merged 1 commit into from
Dec 27, 2018
Merged

add try/except to cheerlights demo #13

merged 1 commit into from
Dec 27, 2018

Conversation

jerryneedell
Copy link
Contributor

fixes #12

<--- b''
[b'']
---> AT+CIPCLOSE
<--- b'CLOSED\r\n\r\nOK\r\n'
Reply is OK!
---------------------------------------- Size:  0

----------------------------------------
IndexError processing Body, retrying
 list index out of range
---> ATE0
<--- b'\r\nOK\r\n'
---> AT+CIPSTATUS
<--- b'STATUS:4\r\n\r\nOK\r\n'
Retrieving data source...---> AT+CIPSTATUS
<--- b'STATUS:4\r\n\r\nOK\r\n'
---> AT+CIPSTART="TCP","api.thingspeak.com",80,10
<--- b'CONNECT\r\n\r\nOK\r\n'
---> AT+CIPSTATUS
<--- b'STATUS:3\r\n+CIPSTATUS:0,"TCP","52.0.246.0",80,59857,0\r\n\r\nOK\r\n'
---> AT+CIPSEND=109
<--- b'\r\nOK\r\n'
<--- b''
Receiving: 1276
[b'HTTP/1.1 200 OK', b'Content-Type: application/json; charset=utf-8', b'Transfer-Encoding: chunked', b'Connection: close', b'Status: 200 OK', b'X-Frame-Options: SAMEORIGIN', b'Access-Control-Allow-Origin: *', b'Access-Control-Allow-Methods: GET, POST, PUT, OPTIONS, DELETE, PATCH', b'Access-Control-Allow-Headers: origin, content-type, X-Requested-With', b'Access-Control-Max-Age: 1800', b'ETag: "97ee10b474406c89ea7eabc03786b9d1"', b'Cache-Control: max-age=0, private, must-revalidate', b'X-Request-Id: a0fd91ad-6f58-423b-be26-d6c956e1fa43', b'X-Runtime: 0.020318', b'X-Powered-By: Phusion Passenger 4.0.57', b'Date: Thu, 27 Dec 2018 16:43:32 GMT', b'Server: nginx/1.9.3 + Phusion Passenger 4.0.57', b'', b'264', b'{"channel":{"id":1417,"name":"CheerLights","description":"CheerLights is an \xe2\x80\x9cInternet of Things\xe2\x80\x9d project created by Hans Scharler that allows people\xe2\x80\x99s lights all across the world to synchronize to one color set by Twitter. This is a way to connect physical things with social networking experiences.","latitude":"40.5","longitude":"-80.22","field1":"Last CheerLights Command","field2":"CheerLights HEX Color","created_at":"2011-12-01T03:30:04Z","updated_at":"2018-07-20T01:05:15Z","last_entry_id":498816},"feeds":[{"created_at":"2018-12-27T16:20:49Z","entry_id":498816,"field1":"pink","field2":"#FFC0CB"}]}', b'0', b'', b'']
---> AT+CIPCLOSE
<--- b'\r\nERROR\r\n'
Reply is OK!
---------------------------------------- Size:  624
264

@ladyada
Copy link
Member

ladyada commented Dec 27, 2018

ooh can you stick the valueerror check here?
https://github.com/adafruit/Adafruit_CircuitPython_ESP_ATcontrol/blob/master/examples/espatcontrol_cheerlights.py#L61
that's a little more elegant?

@jerryneedell
Copy link
Contributor Author

jerryneedell commented Dec 27, 2018

but it failed on the index of lines[1] on line 86 since there is no [1]
https://github.com/adafruit/Adafruit_CircuitPython_ESP_ATcontrol/blob/master/examples/espatcontrol_cheerlights.py#L86

@ladyada
Copy link
Member

ladyada commented Dec 27, 2018

oh right! sorry i thought it was the json indexer. whee!

@ladyada ladyada merged commit a2c5a85 into adafruit:master Dec 27, 2018
tannewt pushed a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jan 16, 2019
Updating https://github.com/adafruit/Adafruit_CircuitPython_74HC595 to 1.0.2 from 1.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_74HC595#3 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15 to 1.0.1 from 1.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_ADS1x15#22 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_AS726x to 1.0.4 from 1.0.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_AS726x#6 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_BluefruitSPI to 1.0.2 from 1.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_BluefruitSPI#10 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_BME280 to 2.2.2 from 2.2.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_BME280#20 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_BMP280 to 3.0.10 from 3.0.9:
  > Merge pull request adafruit/Adafruit_CircuitPython_BMP280#11 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_BMP3XX to 1.1.1 from 1.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_BMP3XX#3 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_CAP1188 to 1.1.1 from 1.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_CAP1188#8 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground to 2.0.5 from 2.0.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_CircuitPlayground#44 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_Crickit to 2.1.4 from 2.1.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_Crickit#12 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_DHT to 3.2.3 from 3.2.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_DHT#21 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_DotStar to 1.5.0 from 1.4.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_DotStar#33 from PaintYourDragon/master
  > Reorder import lines in examples for pylint
  > Add image paint and POV examples
  > Fix too-long line
  > Add SPI baudrate passthrough
  > Merge pull request adafruit/Adafruit_CircuitPython_DotStar#32 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_DRV2605 to 1.0.1 from 1.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_DRV2605#12 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_DS18X20 to 1.1.3 from 1.1.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_DS18X20#9 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_DS3231 to 2.1.3 from 2.1.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_DS3231#14 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_EPD to 1.2.1 from 1.2.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_EPD#6 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP_ATcontrol to 0.2.1 from 0.2.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_ESP_ATcontrol#15 from brentru/particle-argon-post-example
  > Merge pull request adafruit/Adafruit_CircuitPython_ESP_ATcontrol#13 from jerryneedell/jerryn_cheer

Updating https://github.com/adafruit/Adafruit_CircuitPython_Fingerp to 1.1.3 from 1.1.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_Fingerp#10 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_FRAM to 1.2.1 from 1.2.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_FRAM#5 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_GPS to 3.2.1 from 3.2.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_GPS#14 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_HT16K33 to 2.1.2 from 2.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_HT16K33#28 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731 to 2.2.2 from 2.2.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_IS31FL3731#12 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM9DS0 to 2.1.1 from 2.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_LSM9DS0#12 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_MatrixKe to 1.1.4 from 1.1.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_MatrixKe#6 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_MAX9744 to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_MAX9744#7 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP2 to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_MCP2#6 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP3xxx to 1.0.2 from 1.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_MCP3xxx#8 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_MLX90393 to 1.1.3 from 1.1.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_MLX90393#4 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_MPL115A2 to 1.0.2 from 1.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_MPL115A2#3 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_MPR121 to 2.0.1 from 2.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_MPR121#17 from adafruit/keyboard_disable_logging
  > Merge pull request adafruit/Adafruit_CircuitPython_MPR121#16 from adafruit/pi_keyboard
  > Merge pull request adafruit/Adafruit_CircuitPython_MPR121#15 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel to 3.3.5 from 3.3.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_NeoPixel#38 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_PN532 to 2.0.3 from 2.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_PN532#11 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_RFM69 to 1.2.5 from 1.2.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_RFM69#15 from brentru/led-example

Updating https://github.com/adafruit/Adafruit_CircuitPython_RFM9x to 1.1.4 from 1.1.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_RFM9x#16 from brentru/improve-example

Updating https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display to 3.1.2 from 3.1.1:
  > more realistic name
  > update for feather m0/m4
  > allow color to get a list/tuple
  > Merge pull request adafruit/Adafruit_CircuitPython_RGB_Display#23 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_SH to 2.0.2 from 2.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_SH#9 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_TCS34725 to 3.2.1 from 3.2.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_TCS34725#19 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_TFmini to 1.1.1 from 1.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_TFmini#3 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_Thermal_Printer to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_Thermal_Printer#7 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_TMP006 to 1.0.2 from 1.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_TMP006#4 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_TMP007 to 1.0.3 from 1.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_TMP007#4 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_Trellis to 1.2.1 from 1.2.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_Trellis#10 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_TrellisM4 to 1.3.1 from 1.3.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_TrellisM4#17 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_TSL2591 to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_TSL2591#9 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_US100 to 1.0.1 from 1.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_US100#4 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_VC0706 to 4.0.2 from 4.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_VC0706#7 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_VL6180X to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_VL6180X#5 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_VS1053 to 1.1.1 from 1.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_VS1053#4 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_BusDevice to 2.2.8 from 2.2.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_BusDevice#23 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_FancyLED to 1.2.2 from 1.2.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_FancyLED#6 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_HID to 3.3.2 from 3.3.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_HID#29 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation to 0.8.2 from 0.8.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_LED_Animation#3 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_miniesptool to 0.1.3 from 0.1.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_miniesptool#8 from jerryneedell/jerryn_fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_OneWire to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_OneWire#10 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_Slideshow to 1.0.2 from 1.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_Slideshow#9 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_TinyLoRa to 1.0.6 from 1.0.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_TinyLoRa#15 from brentru/single-channel-example
  > Merge pull request adafruit/Adafruit_CircuitPython_TinyLoRa#16 from brentru/fix-typo
  > Merge pull request adafruit/Adafruit_CircuitPython_TinyLoRa#14 from sommersoft/readme_fix_travis
@jerryneedell jerryneedell deleted the jerryn_cheer branch January 30, 2019 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

occasional error in "cheerlights"
2 participants