Unable to store a Serial-received string to an array
hello
i have annoying issue. i'm using library found here: https://github.com/itead/iteadsw_gsm , have modified little on it. case when call simpleread() or whilesimpleread() method in sim900.cpp, serial.prints entire json-object. code snip bellow shows output on serial monitor methods.
so, want store object parameters in reasonable way. thinking of simple appending each character string or char-array, both seems problematic. works first 20 characters, starts skipping of characters, , mess other. so, when try print out string, looks kind of messy.
this gsm-shield interfaced through rx , tx-cables. i'm using software serial.
i'm thinking issue might gps-shield sends data faster arduino able process when needs store characters or something, i'm wondering if interrupt solve or something? i've been thinking serial-monitor slowing things down, i've tried digital write 13 instead, goes high if string contains phone-number. did not work because part of messy part. worked when searched "type".
i've tried different solutions, both in simpleread() method , whilesimpleread() both related string test += _cell.read(), , counter increments in char-array shall store data.
any idea what's going wrong?
i have annoying issue. i'm using library found here: https://github.com/itead/iteadsw_gsm , have modified little on it. case when call simpleread() or whilesimpleread() method in sim900.cpp, serial.prints entire json-object. code snip bellow shows output on serial monitor methods.
so, want store object parameters in reasonable way. thinking of simple appending each character string or char-array, both seems problematic. works first 20 characters, starts skipping of characters, , mess other. so, when try print out string, looks kind of messy.
this gsm-shield interfaced through rx , tx-cables. i'm using software serial.
i'm thinking issue might gps-shield sends data faster arduino able process when needs store characters or something, i'm wondering if interrupt solve or something? i've been thinking serial-monitor slowing things down, i've tried digital write 13 instead, goes high if string contains phone-number. did not work because part of messy part. worked when searched "type".
i've tried different solutions, both in simpleread() method , whilesimpleread() both related string test += _cell.read(), , counter increments in char-array shall store data.
any idea what's going wrong?
code: [select]
data received:
http/1.1 200 ok
date: mon, 03 jul 2017 18:34:49
gmt
content-type: application/json;charset=utf-8
content-length: 534
connection: close
server: apache-coyote/1.1
access-control-allow-origin: *
access-control-allow-credentials: true
access-control-expose-headers: location
{"id":14*****,"countrycode":"no","username":"+479*******","customertype":"private","status":"active","firstname":"****","lastname":"****","email":"*****@gmail.com","emailvalidated":false,"primaryphone":"+479********","productpackageid":63,"activateddate":"2014-**-**t11:56:13.596+0000","billingaccountid":9****,"cars":[{"countrycode":"no","licensenumber":"b*****3"},{"countrycode":"no","licensenumber":"k*****8"}],"deliveryaddress":{"countrycode":"no","street":"r*** 2b","city":"***","postalcode":"***"}}
closed
code: [select]
data received:
http/1.1 200 ok
date: mon, 03 jul 2017 18:13:15
gmt
content-type: application/jso
n;charset=utf-8
content-le
ngth: 534
connection: cl
ose
server: apache-coyo
te/1.1
access-control-a
llow-origin: *
access
-control-allow-credentia
ls: true
access-contr
ol-expose-headers: locat
ion
{"id":1***,"
countrycode":"no","usern
ame":"+479*******","cu
stomertype":"private","s
tatus":"active","first
name":"*****","lastname"
:"**********","email":
"*************@gmail.c
om","emailvalidated":f
alse,"primaryphone":"+47
9********","productpack
ageid":6*,"activateddate
":"2014-**-**t11:56:13
.596+0000","billingaccou
ntid":9******,"cars":[{
"countrycode":"no","lice
nsenumber":"b******"},
{"countrycode":"no","lic
ensenumber":"k*****8"}
],"deliveryaddress":{"co
untrycode":"no","stree
t":"**********","city
":"*******","postalc
ode":"****"}}
where code , did change in library?
Arduino Forum > Using Arduino > Programming Questions > Unable to store a Serial-received string to an array
arduino
Comments
Post a Comment