Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:01 29 Nov 2024 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 : PicoMiteWeb alphas - It had to be done

     Page 3 of 5    
Author Message
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3152
Posted: 04:42pm 05 Feb 2023
Copy link to clipboard 
Print this post

I am way behind the times and have not yet used the flash file system.

Can someone explain how to use it to set up the files as needed for Peter's example?

I'm now connecting to the NTP server and getting "got ntp response" plus date and time, but then the program hangs and I need Ctrl+C to return to the ">" prompt.

I bought the Pico_W when it first came out and was able to find it in a box--actually were it should have been. Excited to get this working.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 05:16pm 05 Feb 2023
Copy link to clipboard 
Print this post

  Quote  Can someone explain how to use it to set up the files as needed for Peter's example?

It is automatically created. Use xmodem to move files onto it from the PC
 
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 351
Posted: 05:26pm 05 Feb 2023
Copy link to clipboard 
Print this post




Copy the 4 files from the ZIP file with:
> xmodem receive "filename"
and then into TeraTerm file Xmodem SEND the matching file.

In the screenshot still the OPTION List.



PicoMiteWebIsGO.zip
Edited 2023-02-06 03:30 by homa
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3152
Posted: 05:49pm 05 Feb 2023
Copy link to clipboard 
Print this post

Ok, working now. Thank you very much for this.


PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 06:00pm 05 Feb 2023
Copy link to clipboard 
Print this post

You can also have the files on an SDcard - just pre-pend "B:/" before the filename - - tested and works just as well
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3152
Posted: 10:17pm 05 Feb 2023
Copy link to clipboard 
Print this post

Ok, this is now being served by the PicoMiteWeb:



A long way to go before it's functional, since I don't know how to interact with it. But very good progress.

I've subsequently seen how to get the date right with "WEB ntp -5", but in my formatting, I don't have the time right or the day of the week.

Lots of potential here.

(For me right now, thebackshed is painfully slow--sometimes minutes to refresh a page. Is anyone else seeing this?)
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
TimD
Newbie

Joined: 23/02/2021
Location: United Kingdom
Posts: 27
Posted: 10:37pm 05 Feb 2023
Copy link to clipboard 
Print this post

Hi Lizby, I'm seeing the same slowness with thebackshed...

- Tim
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 10:40pm 05 Feb 2023
Copy link to clipboard 
Print this post

  Quote  (For me right now, thebackshed is painfully slow--sometimes minutes to refresh a page. Is anyone else seeing this?)

Same in the UK
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6102
Posted: 11:05pm 05 Feb 2023
Copy link to clipboard 
Print this post

TBS speed seems to have recovered now
VK7JH
MMedit   MMBasic Help
 
morgs67
Regular Member

Joined: 10/07/2019
Location: Australia
Posts: 75
Posted: 03:52am 06 Feb 2023
Copy link to clipboard 
Print this post

  homa said  
Copy the 4 files from the ZIP file ....


@homa

Thanks for the instructions, they got me going down the right path.

Tony
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6102
Posted: 03:58am 06 Feb 2023
Copy link to clipboard 
Print this post

With a slight modification to Peters code, a simple weather station is born.
Page refreshes ever 15 seconds and the DHT22 is read every 3 seconds to allow for any bad readings.

BAS file:
 DIM buff%(512)
 DIM mystring$="PicoMite Web Test"
 DIM FLOAT mytemp, myhumid, oldtemp, oldhumid
 DIM mytime$
 TIMER = 3000
 WEB ntp 11
 DO
   poll
   IF TIMER > 3000 THEN doread
 LOOP
'
SUB poll
 LOCAL p%, t%
 FOR a%=1 TO MM.INFO(MAX connections)
   LONGSTRING CLEAR buff%()
   WEB tcp READ a%,buff%()
   p%=LINSTR(buff%(),"GET")
   t%=LINSTR(buff%(),"HTTP")
   IF LLEN(buff%()) THEN PRINT "_________________________________________________"
   s$=""
   IF (p%<>0) AND  (t%<>0) AND (t%>p%) THEN
     s$=LGETSTR$(buff%(),p%,t%-p%+4)
     PRINT "String is ",s$
   ENDIF
   IF INSTR(s$,"small") THEN
     PRINT "sending picture"
     WEB Transmit FILE a%,"small.jpg","image/jpeg"
   ELSEIF INSTR(s$,"favicon") THEN
     PRINT "sending icon"
     WEB Transmit FILE a%,"favicon.ico","image/vnd.microsoft.icon"
   ELSEIF INSTR(s$,"HTTP") THEN
     PRINT "sending page"
     WEB transmit PAGE a%,"st_test.html"
   ENDIF
 NEXT a%
END SUB
 
SUB doread
 BITBANG HUMID GP17, mytemp, myhumid
 IF mytemp > 999 THEN
   mytemp = oldtemp
   myhumid = oldhumid
   PRINT "_";
 ELSE
   oldtemp = mytemp
   oldhumid = myhumid
   PRINT "*";
 ENDIF
 mytime$ = TIME$+"  "+DATE$
 TIMER = 0
END SUB


HTML file:
<html>
<head>
<title>Stowport Test</title>
<meta http-equiv="Refresh" content="15">
</head>
<body>
<h1 align="center">{mystring$}</h1>
<p align="center">Temperature is {mytemp}</p>
<p align="center">Humidity is {myhumid}</p>
<p align="center">Reading taken at {mytime$}</p>
</body>
</html>


Result:



The system is undergoing a soak test.

Jim
VK7JH
MMedit   MMBasic Help
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1873
Posted: 08:22am 09 Feb 2023
Copy link to clipboard 
Print this post

I am trying to save the files to the Flash Drive but failed as usual. Can some one hold my hand and walk me through it.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 08:56am 09 Feb 2023
Copy link to clipboard 
Print this post

XMODEM r "A:/filename"

or if you have an SDcard configured

COPY "B:/filename" to "A:/filename"
 
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 367
Posted: 10:11am 09 Feb 2023
Copy link to clipboard 
Print this post

  matherp said  
  Quote  (For me right now, thebackshed is painfully slow--sometimes minutes to refresh a page. Is anyone else seeing this?)

Same in the UK


In work (local council / government authority) we have a national Microsoft "account" -- Teams and Outlook has been dire since Monday.  Internet likewise is handled by VPN, via HotspotShield -- usually this has a load of around 25% and latency in the xx/ms.   Today, this is 87% and 120ms.

Blame Putin or Kim Jong-un.

N
Entropy is not what it used to be
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 847
Posted: 10:20pm 09 Feb 2023
Copy link to clipboard 
Print this post

Hi Peter et al,
This is a significant leap forward. This is worth giving up GUI for!
I had just succeeded in getting an ESP8266 to access NTP and Openweather but my code is messy and not bullet proof.

Before scrapping my (extensive) use of GUI commands for menus etc I'm just checking the probability of them making a comeback in the future (i.e. from 0% to say 51%) - neither being a commitment.

Many thanks,

Andrew
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 10:27pm 09 Feb 2023
Copy link to clipboard 
Print this post

  Andrew_G said  Before scrapping my (extensive) use of GUI commands for menus etc I'm just checking the probability of them making a comeback in the future (i.e. from 0% to say 51%) - neither being a commitment.


You could always couple two 'mites, one running the standard PicoMite firmware and the other running PicoMiteWEB, best of both worlds ?

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 847
Posted: 10:48pm 09 Feb 2023
Copy link to clipboard 
Print this post

Good idea Tom.

(or, since I'll be running it on my HC-12 network, I could 'broadcast' the incoming web information via serial to the several sites where it can be viewed?
Simple commands for say 'weather' or 'forecast' could be sent to the web station too (messy but might work).

Andrew
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 10:48pm 09 Feb 2023
Copy link to clipboard 
Print this post

0% on the PicoMiteWEB
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 847
Posted: 11:05pm 09 Feb 2023
Copy link to clipboard 
Print this post

Thanks Peter.

Andrew
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 08:34am 02 Apr 2023
Copy link to clipboard 
Print this post

Peter
If you get bored
how about adding Bluetooth Controller support instead of only having one wired controller?
You could then play multiplayer with friends
and either use wireless adaptors for the original Snes or other game controller or even any bluetooth game controller?

mod kit here

Bluetooth support is now available for the Pico W from SDK 1.5 onwards
It's C based
Not sure if this will help or not  
here
  Quote  Bluetooth Support for Pico W (BETA)
The support is currently available as a beta. More details will be forthcoming with the actual release. In the meantime,
there are examples in pico-examples.
Key changes:
• The Bluetooth API is provided by BTstack.
• The following new libraries are provided that expose core BTstack functionality:
◦ pico_btstack_ble - Adds Bluetooth Low Energy (LE) support.
◦ pico_btstack_classic - Adds Bluetooth Classic support.
◦ pico_btstack_sbc_encoder - Adds Bluetooth Sub Band Coding (SBC) encoder support.
◦ pico_btstack_sbc_decoder - Adds Bluetooth Sub Band Coding (SBC) decoder support.
◦ pico_btstack_bnep_lwip - Adds Bluetooth Network Encapsulation Protocol (BNEP) support using LwIP.
◦ pico_btstack_bnep_lwip_sys_freertos - Adds Bluetooth Network Encapsulation Protocol (BNEP) support using
LwIP with FreeRTOS for NO_SYS=0.
• The following integration libraries are also provided:
◦ pico_btstack_run_loop_async_context - provides a common async_context backed implementation of a BTstack
"run loop" that can be used for all BTstack use with the pico-sdk.
◦ pico_btstack_flash_bank - provides a sample implementation for storing required Bluetooth state in flash.
◦ pico_btstack_cyw43 - integrates BTstack with the CYW43 driver.
• Added CMake function pico_btstack_make_gatt_header that can be used to run the BTstack compile_gatt tool to make a
Raspberry Pi Pico C/C++ SDK
Release 1.5.0 (11/Feb/2023) 177
GATT header file from a BTstack GATT file.
• Updated pico_cyw43_driver and cyw43_driver to support HCI communication for Bluetooth.
• Updated cyw43_driver_picow to support Pico W specific HCI communication for Bluetooth over SPI.
• Updated cyw43_arch_init() and cyw43_arch_deinit() to additionally handle Bluetooth support if CYW43_ENABLE_BLUETOOTH
is 1 (as it will be automatically if you depend on pico_btstack_cyw43).

Edited 2023-04-02 18:35 by lew247
 
     Page 3 of 5    
Print this page
© JAQ Software 2024