![]() |
Forum Index : Microcontroller and PC projects : WEB NTP errors
Page 1 of 2 ![]() ![]() |
|||||
Author | Message | ||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Reply to palcal in picomite web lessons thread untested but try: ' n = 0 DO DATE$ = "01-04-2000" ON ERROR SKIP WEB ntp 11 IF DATE$ = "01-04-2000" THEN PRINT "OOPS!" INC n LOOP UNTIL DATE$ <>"01-04-2000" OR n > 4 Jim VK7JH MMedit |
||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1993 |
Thanks Jim that works, do you have any idea why I am getting the line when I run the program. I did have Peter's program in the Pico previously but it has been reflashed since then. "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Reflashing doesn't always delete the program in memory. Try list all to see what is there. Jim VK7JH MMedit |
||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1993 |
List all only lists the current program from Luc. Files only shows 'bootcount' and 'first.html' flash list shows all slots available. I'm using alpha 19 Edited 2023-03-01 11:39 by palcal "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3378 |
Are you entering the picomiteweb's IP address in your browser? After the program says "String is GET / HTTP" you will get the message you showed as the browser retrieves the favicon. If your HTML contains a refresh, you will get it repeatedly. My html calls for a refresh every 120 seconds, and every time the console shows: "String is GET/favicon.ico HTTP". PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1993 |
Lizby said where is it getting it from it is no longer anywhere in the Pico. And why "favicon.ico' there were other files associated with Peter's code. Edited 2023-03-01 11:52 by palcal "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Most web browsers expect the web site to have the file favicon.ico in the root folder of the web site. This is what gives you the pretty pictures in bookmark list etc. You don't have to worry about it for now. There are some PCs that like to be different. Any MAC will usually ignore the favicon.ico and expect your site to have their equivalent icon file, just because MACs are 'special' Jim VK7JH MMedit |
||||
phil99![]() Guru ![]() Joined: 11/02/2018 Location: AustraliaPosts: 2640 |
There is a copy of favicon.ico in this zip. https://www.thebackshed.com/forum/uploads/matherp/2023-02-07_040659_simpleweb.zip Copy it to A: and SD if one is attached, covering all bases it should find it. |
||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1993 |
Thanks it sort of makes sense now, I thought Peter had included it in his 'SimpleWeb' for testing purposes. I have the favicon.ico file, I will put it back in A: "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1993 |
I don't understand this part of the code.. WEB tcp interrupt serverstart Do Loop What triggers the interrupt and why doesn't the program get stuck inside the Do/LOOP "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4044 |
WEB tcp interrupt serverstart Do Loop What triggers the interrupt and why doesn't the program get stuck inside the Do/LOOP MMBasic itself does it. The rest of the program is indeed stuck in the loop. You can add code in the loop if there's anything you want to add. John Edited 2023-03-03 07:29 by JohnS |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
This line tells MMBasic to call 'serverstart' sub whenever there is a connection to the pico port. It is up to the 'serverstart' sub to handle the connection from then on. The interrupts are usually checked between every line so in the do...loop code, the programs checks to see if the interrupt has bee triggered each time the program goes through the loop. It is only slow commands (some of the ones that talk to external sensors) that disable the interrupts that cause delays in servicing the 'serverstart' interrupt sub. Jim VK7JH MMedit |
||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1993 |
Thanks, I'll understand it all one day, I hope. "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
LucV![]() Regular Member ![]() Joined: 19/02/2023 Location: NetherlandsPosts: 62 |
Hi Palcal. Maybe I can simplify it a bit. I presume you know how an interrupt works. For simplicity let's compare it to your home situation. Imagine you are setting the table for lunch. Then the doorbell rings. That is the interrupt. So you stop what you are doing and go to the door. Now let's translate that into our program. The Do-Loop is our program. It is like setting the table. The difference is that our program is actually doing nothing. It is an empty loop. Like you not setting the table but just sitting on the couch doing nothing. WEB tcp interrupt serverstart That is part of our total program that starts the interrupt. So this is the part where someone rings the bell. Actually nothing happens all the time till someone rings the bell. Then the interrupt comes to action and switches over to the subroutine with the name serverstart. In our situation this part compare ringing the bell to the program waiting till you open your web browser, paste in the IP address of the PicoMiteWeb and hit return. That is "ringing the bell". Then the PicoMiteWEb comes into action and starts the serverstart routine which you can compare to you walking to the door and opening it. When the door is opened and you recdeived a package or whatever you go back to setting the table. So does our program is reusmes what it would be doing in the do-loop. This means that later on we can add more things in our program like doing calculations or reading sensors etc etc etc and each time someone hits refresh in the browser or someone else on another computer or phone opens his/hers browser and types in the ip-adress the interrupt is activated, sends the web-page to the one requesting it and goes on with what it was doing. Does this help ??? Luc Luc's tech Blog |
||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1993 |
Thanks Luc, I understand interrupts but could not see how this one was being triggered, it is all clear now and thanks for the good explanation. "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
Luc, your description is excellent. You should be a school teacher in understanding code. Perhaps you are! ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
pwillard Guru ![]() Joined: 07/06/2022 Location: United StatesPosts: 313 |
ARGH!!!! > run Assigned Address: 192.168.1.224 NTP FAILURE > run Assigned Address: 192.168.1.224 NTP FAILURE > run Assigned Address: 192.168.1.224 NTP FAILURE > run Assigned Address: 192.168.1.224 NTP FAILURE > run Assigned Address: 192.168.1.224 NTP FAILURE > run Assigned Address: 192.168.1.224 NTP FAILURE > run Assigned Address: 192.168.1.224 NTP FAILURE > |
||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1993 |
@pwillard, looks like you havn't added Jim's code to SERVER.01 "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
pwillard Guru ![]() Joined: 07/06/2022 Location: United StatesPosts: 313 |
Oh, that code is in my program... It's what is printing "NTP FAILURE" |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
My code should print OOPS! 5 times if the NTP failed totally. n = 0 DO DATE$ = "01-04-2000" ON ERROR SKIP WEB ntp 11 IF DATE$ = "01-04-2000" THEN PRINT "OOPS!" INC n LOOP UNTIL DATE$ <>"01-04-2000" OR n > 4 I don't see any in your output. Jim VK7JH MMedit |
||||
Page 1 of 2 ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |