0

Unable to connect to adafruit io
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Unable to connect to adafruit io

by Laky on Thu Feb 28, 2019 1:39 am

Hi,
im currently working on my IoT project which requires some remote control which i found it possible using adafruit io. But i'm not very sure with whether it will be useful to me not as my existing hardware does not use adafruit hardware but it is some thing similar to FONA808 it is a local board wit SIM808. So,my question is whether I will be able to use adafruit IO or not?.
I have connected my arduino Uno to my SIM808 module and when i run an example sketch to control servo it runs into a loop which looks something like this:
Code: Select all | TOGGLE FULL SIZE
Connecting to Adafruit IOAdafruitIO::connect()
Attempting to open comm with ATs
   ---> AT
   <--- OK
   ---> ATE0
   <--- OK
   ---> ATE0
   <--- OK
   ---> AT+CVHU=0
   <--- OK
   ---> ATI
   <--- SIM808 R14.18

OK

   ---> AT+CPMS="SM","SM","SM"
   <--- +CPMS: 1,20,1,20,1,20
   ---> AT+CGATT?
   <--- +CGATT: 1
   ---> AT+CIPSTATUS
   <--- OK
   <--- STATE: CONNECT OK

Adafruit IO connected.
MQTT publish packet:
   0 [0x30],   [0x16],   [0x00],   [0x14], L [0x4C], a [0x61], k [0x6B], y [0x79],
   / [0x2F], f [0x66], / [0x2F], s [0x73], e [0x65], r [0x72], v [0x76], o [0x6F],
   / [0x2F], c [0x63], s [0x73], v [0x76], / [0x2F], g [0x67], e [0x65], t [0x74],
   
Writing packet
   ---> AT+CIPSTATUS
   <--- OK
   <--- STATE: CONNECT OK
AT+CIPSEND=24
 0x30 0x16 0x0 0x14 0x4C 0x61 0x6B 0x79 0x2F 0x66 0x2F 0x73 0x65 0x72 0x76 0x6F 0x2F 0x63 0x73 0x76 0x2F 0x67 0x65 0x74
   <--- >
   <--- SEND OK
   ---> AT+CIPSTATUS
   <--- OK
   <--- STATE: CONNECT OK
Reading data..
   ---> AT+CIPSTATUS
   <--- OK
   <--- STATE: CONNECT OK
   ---> AT+CIPSTATUS
   <--- OK
   <--- STATE: CONNECT OK
   ---> AT+CIPRXGET=4
   <--- +CIPRXGET: 4,26
26 bytes available
1 bytes read
 0x30
Read:      0 [0x30],
Packet Type:      0 [0x30],
Reading data..
   ---> AT+CIPSTATUS
   <--- OK
   <--- STATE: CONNECT OK
   ---> AT+CIPSTATUS
   <--- OK
   <--- STATE: CONNECT OK
   ---> AT+CIPRXGET=4
   <--- +CIPRXGET: 4,25
25 bytes available
1 bytes read
 0x18
Read:        [0x18],
Packet Length:   24
Reading data..
   ---> AT+CIPSTATUS
   <--- OK
   <--- STATE: CONNECT OK
   ---> AT+CIPSTATUS
   <--- OK
   <--- STATE: CONNECT OK
   ---> AT+CIPRXGET=4
   <--- +CIPRXGET: 4,24
24 bytes available
24 bytes read
 0x0 0x10 0x4C 0x61 0x6B 0x79 0x2F 0x66 0x2F 0x73 0x65 0x72 0x76 0x6F 0x2F 0x63 0x73 0x76 0x36 0x30 0x2C 0x2C 0x2C 0xA
Read:        [0x00],   [0x10], L [0x4C], a [0x61], k [0x6B], y [0x79], / [0x2F], f [0x66],
   / [0x2F], s [0x73], e [0x65], r [0x72], v [0x76], o [0x6F], / [0x2F], c [0x63],
   s [0x73], v [0x76], 6 [0x36], 0 [0x30], , [0x2C], , [0x2C], , [0x2C],   [0x0A],
   
Packet len: 26
   0 [0x30],   [0x18],   [0x00],   [0x10], L [0x4C], a [0x61], k [0x6B], y [0x79],
   / [0x2F], f [0x66], / [0x2F], s [0x73], e [0x65], r [0x72], v [0x76], o [0x6F],
   / [0x2F], c [0x63], s [0x73], v [0x76], 6 [0x36], 0 [0x30], , [0x2C], , [0x2C],
   , [0x2C],   [0x0A],
Looking for subscription len 16
Found sub #0
Data len: 6
Data: 60,,,

   ---> AT+CIPSTATUS
   <--- OK
   <--- STATE: CONNECT OK
Reading data..
   ---> AT+CIPSTATUS
   <--- OK
   <--- STATE: CONNECT OK
   ---> AT+CIPSTATUS
   <--- OK
   <--- STATE: CONNECT OK
   ---> AT+CIPRXGET=4
   <--- +CIPRXGET: 4,0
0 bytes available
   ---> AT+CIPSTATUS
   <--- OK
   <--- STATE: CONNECT OK
Reading data..
   ---> AT+CIPSTATUS
   <--- OK
   <--- STATE: CONNECT OK
   ---> AT+CIPSTATUS
   <--- OK
   <--- STATE: CONNECT OK
   ---> AT+CIPRXGET=4
   <--- +CIPRXGET: 4,0



here the "Reading data and 0 bytes available" will be in the loop continuously . Kindly help me with this.
Last edited by franklin97355 on Thu Feb 28, 2019 3:00 am, edited 1 time in total.
Reason: Please use code tags when posting code or logs to the forums. It preserves formatting and makes it easier for everyone to read the code. Click the code button above the reply box and past your code between the tags created.

Laky
 
Posts: 1
Joined: Sun Feb 24, 2019 2:06 am

Re: Unable to connect to adafruit io

by abachman on Mon Mar 04, 2019 12:06 pm

Hi Laky,


Looking at the output where it says:

Code: Select all | TOGGLE FULL SIZE
Looking for subscription len 16
Found sub #0
Data len: 6
Data: 60,,,


It looks like your code is getting a response to the MQTT .../get message. The response is in CSV format--{value},{latitude},{longitude},{elevation}--where the value is 60 and location fields are blank.

As far as the repeating "Reading data and 0 bytes available" message, it could be that your MQTT library is polling the cellular modem for new data and seeing nothing, which is normal for an always-open MQTT connection that isn't actively receiving data. Are you trying to send data to your device from io.adafruit.com or another sketch?


- adam b.

abachman
 
Posts: 286
Joined: Mon Feb 01, 2010 12:48 pm

Please be positive and constructive with your questions and comments.