[Coco] Basic09 procedure to access the ESP8266 wifi modem

Doug Fraser zathrasldf at outlook.com
Fri Jan 15 23:07:01 EST 2021


I have an ESP8266 for use as a WiFi modem using a modified DCModrm pak, for RS-232 pak. There is a Hayes command to access the NTP time server so one can set the system time. As I use primarily Nitros9, I've tried the following procedure in Basic09, but it just prints the command to the screen and exits, when its supposed to set the timezone and return the time for eventually setting the system time. For any Nitros9 gurus out there, what am I missing?

PROCEDURE netime
(* Variables
PARAM modem,timezone:STRING[4]
DIM path:BYTE
DIM atcommand,ntptime:STRING

(* Prep the Hayes at&t command
atcommand="at&t "+chr$(34)+timezone+chr$(34)

(* Open path to serial port
OPEN #path,modem:UPDATE

(* set up timezone
WRITE #path,atcommand

(*  ask for time
atcommand="at&t"
WRITE #path,atcommand

READ #path,ntptime
CLOSE #path
PRINT ntptime

Any help would be greatly appreciated.
Doug


Get Outlook for Android<https://aka.ms/ghei36>


More information about the Coco mailing list