Current News

Moderator: Mmiscool

User avatar
By peridot
#44951 Jim, I have found those $ characters in you string variables ill cause it to crash. Mike


viscomjim wrote:I am not sure what the actual problem is right now, but I will try and break the program down to see where it fails. This little program works very well under the "stable" version, but bombs in the 2.0 alpha version. I think I saw a thread where someone said that using a variable with the wget command wasn't working in the newest firmware, so I will try and start there for troubleshooting.

Code: Select allcls
button "Click to send " [checkit]
button "Exit " [Exit]
timer 30000 [checkit]
wait
'
[checkit]
WBString = "api.openweathermap.org/data/2.5/weather?id=4174855&units=imperial&appid=yourapikeyhere"
a$ = wget(WBString)
'serialprintln a$

serialprintln json(a$,"description")
serialprintln json(a$,"temp")
serialprintln json(a$,"pressure")
serialprintln json(a$,"humidity")
serialprintln json(a$,"name")
serialprintln json(a$,"speed")
serialprintln json(a$,"deg")

let tim = json(a$,"dt")
let timj = unixtime(tim)
serialprintln ""
serialprint "unix time = "
serialprintln tim
serialprintln ""
serialprint "time = "
serialprintln timj
serialprintln ""

wait
[Exit]
timer 0
wprint "<a href='/'>Menu</a>"
end