Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 03:42 11 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Serial input max number

Author Message
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 10:29pm 06 Mar 2018
Copy link to clipboard 
Print this post

What is the maximum length of characters that can be received on the serial port on the Explore 100?

I can't figure a way to power my outdoor weather micromite by solar here in the UK reliably, so I'm going to try a different way to do the weather.
I plan on using en ESP8266 to receive the weather from Wunderground and then parse and display it

ESP Basic hasn't got the capability to receive and parse the amount of info so what I plan on doing is passing it direct to the Micromite

What I want to know is will the Micromite be capable of receiving the following amount of data and then parsing it?

If I call the current weather the responce would this amount of data
[code]
{
"response": {
"version":"0.1",
"termsofService":"http://www.wunderground.com/weather/api/d/terms.html",
"features": {
"conditions": 1
}
}
, "current_observation": {
"image": {
"url":"http://icons.wxug.com/graphics/wu2/logo_130x80.png",
"title":"Weather Underground",
"link":"http://www.wunderground.com"
},
"display_location": {
"full":"Hulme, United Kingdom",
"city":"Hulme",
"state":"MAN",
"state_name":"United Kingdom",
"country":"UK",
"country_iso3166":"GB",
"zip":"00000",
"magic":"106",
"wmo":"03334",
"latitude":"53.47000122",
"longitude":"-2.25000000",
"elevation":"36.0"
},
"observation_location": {
"full":"Manchester, Manchester City Centre, MAN",
"city":"Manchester, Manchester City Centre",
"state":"MAN",
"country":"UK",
"country_iso3166":"GB",
"latitude":"53.479355",
"longitude":"-2.235099",
"elevation":"180 ft"
},
"estimated": {
},
"station_id":"IMANMANC12",
"observation_time":"Last Updated on March 6, 9:58 PM GMT",
"observation_time_rfc822":"Tue, 06 Mar 2018 21:58:09 +0000",
"observation_epoch":"1520373489",
"local_time_rfc822":"Tue, 06 Mar 2018 22:22:52 +0000",
"local_epoch":"1520374972",
"local_tz_short":"GMT",
"local_tz_long":"Europe/London",
"local_tz_offset":"+0000",
"weather":"Mostly Cloudy",
"temperature_string":"44.8 F (7.1 C)",
"temp_f":44.8,
"temp_c":7.1,
"relative_humidity":"100%",
"wind_string":"From the SSW at 1.9 MPH Gusting to 4.3 MPH",
"wind_dir":"SSW",
"wind_degrees":199,
"wind_mph":1.9,
"wind_gust_mph":"4.3",
"wind_kph":3.1,
"wind_gust_kph":"6.9",
"pressure_mb":"989",
"pressure_in":"29.21",
"pressure_trend":"0",
"dewpoint_string":"45 F (7 C)",
"dewpoint_f":45,
"dewpoint_c":7,
"heat_index_string":"NA",
"heat_index_f":"NA",
"heat_index_c":"NA",
"windchill_string":"45 F (7 C)",
"windchill_f":"45",
"windchill_c":"7",
"feelslike_string":"45 F (7 C)",
"feelslike_f":"45",
"feelslike_c":"7",
"visibility_mi":"6.2",
"visibility_km":"10.0",
"solarradiation":"--",
"UV":"0","precip_1hr_string":"-999.00 in ( 0 mm)",
"precip_1hr_in":"-999.00",
"precip_1hr_metric":" 0",
"precip_today_string":"0.06 in (2 mm)",
"precip_today_in":"0.06",
"precip_today_metric":"2",
"icon":"mostlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/nt_mostlycloudy.gif",
"forecast_url":"http://www.wunderground.com/global/stations/03334.html",
"history_url":"http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=IMANMANC12",
"ob_url":"http://www.wunderground.com/cgi-bin/findweather/getForecast?query=53.479355,-2.235099",
"nowcast":""
}
}[/code]

and if I wanted to call the forecast this amount of data

[code]
{
"response": {
"version":"0.1",
"termsofService":"http://www.wunderground.com/weather/api/d/terms.html",
"features": {
"forecast": 1
}
}
,
"forecast":{
"txt_forecast": {
"date":"9:27 PM GMT",
"forecastday": [
{
"period":0,
"icon":"mostlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/mostlycloudy.gif",
"title":"Tuesday",
"fcttext":"Mainly cloudy. Lows overnight in the low 30s.",
"fcttext_metric":"Mainly cloudy. Low 1C.",
"pop":"10"
}
,
{
"period":1,
"icon":"nt_mostlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/nt_mostlycloudy.gif",
"title":"Tuesday Night",
"fcttext":"Considerable cloudiness. Low 33F. Winds light and variable.",
"fcttext_metric":"Mostly cloudy. Low 1C. Winds light and variable.",
"pop":"10"
}
,
{
"period":2,
"icon":"partlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/partlycloudy.gif",
"title":"Wednesday",
"fcttext":"Cloudy early with partial sunshine expected late. Slight chance of a rain shower. High 46F. Winds SW at 5 to 10 mph.",
"fcttext_metric":"Cloudy skies early, followed by partial clearing. Slight chance of a rain shower. High 8C. Winds SW at 10 to 15 km/h.",
"pop":"20"
}
,
{
"period":3,
"icon":"nt_chancerain",
"icon_url":"http://icons.wxug.com/i/c/k/nt_chancerain.gif",
"title":"Wednesday Night",
"fcttext":"Mostly clear skies early. Becoming mostly cloudy with showers developing later at night. Snow may mix in. Low 33F. Winds S at 5 to 10 mph. Chance of rain 40%.",
"fcttext_metric":"Mostly clear skies early. Becoming mostly cloudy with showers developing later at night. Snow may mix in. Low 1C. Winds light and variable. Chance of rain 40%.",
"pop":"40"
}
,
{
"period":4,
"icon":"chancerain",
"icon_url":"http://icons.wxug.com/i/c/k/chancerain.gif",
"title":"Thursday",
"fcttext":"Cloudy with occasional showers for the afternoon. High near 45F. Winds WSW at 10 to 15 mph. Chance of rain 50%.",
"fcttext_metric":"Cloudy with rain and snow showers early changing to mainly rain showers in the afternoon. High 7C. Winds WSW at 10 to 15 km/h. Chance of rain 50%.",
"pop":"50"
}
,
{
"period":5,
"icon":"nt_partlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/nt_partlycloudy.gif",
"title":"Thursday Night",
"fcttext":"A few clouds. Scattered frost possible. Low 33F. Winds SW at 5 to 10 mph.",
"fcttext_metric":"A few clouds. Scattered frost possible. Low near 0C. Winds SW at 10 to 15 km/h.",
"pop":"10"
}
,
{
"period":6,
"icon":"clear",
"icon_url":"http://icons.wxug.com/i/c/k/clear.gif",
"title":"Friday",
"fcttext":"Sunshine and some clouds. High 48F. Winds WSW at 5 to 10 mph.",
"fcttext_metric":"Generally sunny despite a few afternoon clouds. High 9C. Winds WSW at 10 to 15 km/h.",
"pop":"10"
}
,
{
"period":7,
"icon":"nt_rain",
"icon_url":"http://icons.wxug.com/i/c/k/nt_rain.gif",
"title":"Friday Night",
"fcttext":"Showers early, becoming a steady rain late. Low 38F. Winds E at 10 to 15 mph. Chance of rain 90%.",
"fcttext_metric":"Rain. Low 3C. Winds ENE at 15 to 25 km/h. Chance of rain 90%.",
"pop":"90"
}
]
},
"simpleforecast": {
"forecastday": [
{"date":{
"epoch":"1520362800",
"pretty":"7:00 PM GMT on March 06, 2018",
"day":6,
"month":3,
"year":2018,
"yday":64,
"hour":19,
"min":"00",
"sec":0,
"isdst":"0",
"monthname":"March",
"monthname_short":"Mar",
"weekday_short":"Tue",
"weekday":"Tuesday",
"ampm":"PM",
"tz_short":"GMT",
"tz_long":"Europe/London"
},
"period":1,
"high": {
"fahrenheit":"45",
"celsius":"7"
},
"low": {
"fahrenheit":"33",
"celsius":"1"
},
"conditions":"Mostly Cloudy",
"icon":"mostlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/mostlycloudy.gif",
"skyicon":"",
"pop":10,
"qpf_allday": {
"in": 0.00,
"mm": 0
},
"qpf_day": {
"in": null,
"mm": null
},
"qpf_night": {
"in": 0.00,
"mm": 0
},
"snow_allday": {
"in": 0.0,
"cm": 0.0
},
"snow_day": {
"in": null,
"cm": null
},
"snow_night": {
"in": 0.0,
"cm": 0.0
},
"maxwind": {
"mph": 9,
"kph": 15,
"dir": "",
"degrees": 0
},
"avewind": {
"mph": 1,
"kph": 2,
"dir": "SSW",
"degrees": 195
},
"avehumidity": 87,
"maxhumidity": 0,
"minhumidity": 0
}
,
{"date":{
"epoch":"1520449200",
"pretty":"7:00 PM GMT on March 07, 2018",
"day":7,
"month":3,
"year":2018,
"yday":65,
"hour":19,
"min":"00",
"sec":0,
"isdst":"0",
"monthname":"March",
"monthname_short":"Mar",
"weekday_short":"Wed",
"weekday":"Wednesday",
"ampm":"PM",
"tz_short":"GMT",
"tz_long":"Europe/London"
},
"period":2,
"high": {
"fahrenheit":"46",
"celsius":"8"
},
"low": {
"fahrenheit":"33",
"celsius":"1"
},
"conditions":"Partly Cloudy",
"icon":"partlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/partlycloudy.gif",
"skyicon":"",
"pop":20,
"qpf_allday": {
"in": 0.03,
"mm": 1
},
"qpf_day": {
"in": 0.00,
"mm": 0
},
"qpf_night": {
"in": 0.03,
"mm": 1
},
"snow_allday": {
"in": 0.0,
"cm": 0.0
},
"snow_day": {
"in": 0.0,
"cm": 0.0
},
"snow_night": {
"in": 0.0,
"cm": 0.0
},
"maxwind": {
"mph": 10,
"kph": 16,
"dir": "SW",
"degrees": 226
},
"avewind": {
"mph": 8,
"kph": 13,
"dir": "SW",
"degrees": 226
},
"avehumidity": 75,
"maxhumidity": 0,
"minhumidity": 0
}
,
{"date":{
"epoch":"1520535600",
"pretty":"7:00 PM GMT on March 08, 2018",
"day":8,
"month":3,
"year":2018,
"yday":66,
"hour":19,
"min":"00",
"sec":0,
"isdst":"0",
"monthname":"March",
"monthname_short":"Mar",
"weekday_short":"Thu",
"weekday":"Thursday",
"ampm":"PM",
"tz_short":"GMT",
"tz_long":"Europe/London"
},
"period":3,
"high": {
"fahrenheit":"45",
"celsius":"7"
},
"low": {
"fahrenheit":"33",
"celsius":"1"
},
"conditions":"Chance of Rain",
"icon":"chancerain",
"icon_url":"http://icons.wxug.com/i/c/k/chancerain.gif",
"skyicon":"",
"pop":50,
"qpf_allday": {
"in": 0.06,
"mm": 2
},
"qpf_day": {
"in": 0.06,
"mm": 2
},
"qpf_night": {
"in": 0.00,
"mm": 0
},
"snow_allday": {
"in": 0.0,
"cm": 0.0
},
"snow_day": {
"in": 0.0,
"cm": 0.0
},
"snow_night": {
"in": 0.0,
"cm": 0.0
},
"maxwind": {
"mph": 15,
"kph": 24,
"dir": "WSW",
"degrees": 251
},
"avewind": {
"mph": 10,
"kph": 16,
"dir": "WSW",
"degrees": 251
},
"avehumidity": 79,
"maxhumidity": 0,
"minhumidity": 0
}
,
{"date":{
"epoch":"1520622000",
"pretty":"7:00 PM GMT on March 09, 2018",
"day":9,
"month":3,
"year":2018,
"yday":67,
"hour":19,
"min":"00",
"sec":0,
"isdst":"0",
"monthname":"March",
"monthname_short":"Mar",
"weekday_short":"Fri",
"weekday":"Friday",
"ampm":"PM",
"tz_short":"GMT",
"tz_long":"Europe/London"
},
"period":4,
"high": {
"fahrenheit":"48",
"celsius":"9"
},
"low": {
"fahrenheit":"38",
"celsius":"3"
},
"conditions":"Clear",
"icon":"clear",
"icon_url":"http://icons.wxug.com/i/c/k/clear.gif",
"skyicon":"",
"pop":10,
"qpf_allday": {
"in": 0.19,
"mm": 5
},
"qpf_day": {
"in": 0.00,
"mm": 0
},
"qpf_night": {
"in": 0.19,
"mm": 5
},
"snow_allday": {
"in": 0.0,
"cm": 0.0
},
"snow_day": {
"in": 0.0,
"cm": 0.0
},
"snow_night": {
"in": 0.0,
"cm": 0.0
},
"maxwind": {
"mph": 10,
"kph": 16,
"dir": "WSW",
"degrees": 237
},
"avewind": {
"mph": 8,
"kph": 13,
"dir": "WSW",
"degrees": 237
},
"avehumidity": 70,
"maxhumidity": 0,
"minhumidity": 0
}
]
}
}
}[/code]
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9750
Posted: 10:52pm 06 Mar 2018
Copy link to clipboard 
Print this post

So long as you use one of the buffered UART COM ports and NOT a Cfunction serial port, then you can setup the buffers to be as big as you want. The trade-off is you lose RAM to the buffers.

See the MM manual, Appendix A, Page 82. This tells you all about the serial ports.

For example, you could setup COM1 so that it's input buffer was 5k:

OPEN "COM1:9600,5000" as #1

That will assign 5000 bytes of memory to the COM1 input buffer - scale that as you need or to suit your available memory. Then your MM can receive up to 5k of data on COM1 in the background, and your main code only needs to check the buffer to see if there is data there, then parse it. There would be quite a bit of parsing of the second example, but if you are prepared to do it....
Smoke makes things work. When the smoke gets out, it stops!
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 10:32pm 07 Mar 2018
Copy link to clipboard 
Print this post

Thanks
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025