IMP serial timeout error

I am having problems with connecting the IMP to the weather station (WIMP). The steps followed and the components bought are detailed in the “Weather Station Wirelessly Connected to Wunderground” blog post (https://learn.sparkfun.com/tutorials/weather-station-wirelessly-connected-to-wunderground). The weather station is fully working under the arduino IDE. Each time a “!” is sent using the console, the weather station returns the meteorological data.

`Wimp Weather Station online!
$,winddir=0,windspeedmph=0.0,windgustmph=0.0,windgustdir=0,windspdmph_avg2m=0.0,winddir_avg2m=0,windgustmph_10m=0.0,windgustdir_10m=0,humidity=44.4,tempf=78.7,rainin=0.00,dailyrainin=0.00,102097.50,batt_lvl=4.46,light_lvl=0.12,#,
$,winddir=23,windspeedmph=7.3,windgustmph=14.5,windgustdir=45,windspdmph_avg2m=0.2,winddir_avg2m=1,windgustmph_10m=14.5,windgustdir_10m=45,humidity=44.4,tempf=78.9,rainin=0.00,dailyrainin=0.00,102098.50,batt_lvl=4.46,light_lvl=0.08,#,
Pinged!$,winddir=225,windspeedmph=1.6,windgustmph=14.5,windgustdir=45,windspdmph_avg2m=0.2,winddir_avg2m=225,windgustmph_10m=14.5,windgustdir_10m=45,humidity=51.0,tempf=74.0,rainin=0.03,dailyrainin=0.03,102142.50,batt_lvl=4.43,light_lvl=0.11,#,
Pinged!`

After connecting the IMP card using the Android phone app and running the agent and device code into the electric imp IDE, it is obtained the following cyclic message error:

`2016-02-09 20:16:15 UTC+1	[Device]	Device started, impee_id 232c11aa5ba5ceee and mac = 0c2a6904fb34
2016-02-09 20:16:15 UTC+1	[Device]	Gathering new weather data
2016-02-09 20:16:17 UTC+1	[Device]	Serial timeout error initial
2016-02-09 20:16:17 UTC+1	[Device]	Nothing to do, going to sleep for 60 seconds
2016-02-09 20:16:17 UTC+1	[Device]	sleeping until 1455045437000
2016-02-09 20:16:17 UTC+1	[Status]	Device disconnected`

What is happenning? Somebody can help me?

Thanks and regards!

P.S.: The used agent and device code are in the attached zip file.

That error appears to indicate that the imp is not receiving anything from the arduino. Might be the level translators on the shield, if you’re using the exact setup in the link?

Hi Hugo, thank you very much for your attention. Is there any simple way to check that problem (e.g. an agent/device code)?

Hmm, you could just configure the RX pin as an input and print the input value? eg:

hardware.pinX.configure(DIGITAL_IN_PULLDOWN);
server.log(hardware.pinX.read());

…a serial port idles high, so this should return 1. If it doesn’t, then the pin likely isn’t connected.

I have been using a modified version of the Sparkfun code for a project for over a year and have run into the problem several times. In my application, the problem usually occurs when the message was sent before the Imp was ready for it. Try putting a delay or use a timer before sending the message to the Imp.

@ccoward the imp has serial buffers, so this shouldn’t be an issue. Are you reading data in a callback? Any blocking operations?