Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:40 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 : PicoMite MMBasic Version 5.07.07a29 with TFTP

     Page 1 of 2    
Author Message
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 351
Posted: 08:20pm 27 Mar 2023
Copy link to clipboard 
Print this post

PicoMite MMBasic Version 5.07.07a29 with TFTP (Trivial File Transfer Protocol)

First of all @Peter many many thanks! This version looks very promising and could almost be the first beta. Long term stable, paramaters via POST work again. In between I was a bit sad because of the featuritis and the missing instability. But then came TFTP and that has surprised me then but very positive!
Unfortunately tftp which is included in Windows (after enabling it in the features) can't do wildcards. Also not in the CMD.
But in the Powershell I then searched the following command together (I'm a beginner in PS!):


Get-ChildItem *.txt | ForEach-Object -Process {if (!$_.PSIsContainer) {tftp -i 192.168.1.119 put $_.Name;} Start-Sleep -seconds 1}

The parameter -i is important (otherwise e.g. no images will work). With this command e.g. only .TXT or .HTML or also all (*.*) files from the current directory can be transferred to the PicoMite in one go! The pause is important so that the PicoMite can keep up with the requests.





Also the deletion on the PicoMite works with wildcards (e.g. kill "*.txt"). @Peter: Is it possible to pass a -y or -all here? Otherwise you have to confirm each file individually.
Since TFTP doesn't know DIR, you can't GET files with wildcards.

Cool is also that TFTP works if a basic program (e.g. the simple web server) is executed on the PicoMite. So files can be exchanged or added during operation.

But that brings me to the next question @Peter:  Please create the possibility for security to enable/disable TFTP from the PicoMite side. Preferably not only as OPTION but also as basic command, then you can activate this in your program for e.g. updates. Thanks!

Matthias
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 09:45pm 27 Mar 2023
Copy link to clipboard 
Print this post

  Quote  Also the deletion on the PicoMite works with wildcards (e.g. kill "*.txt"). @Peter: Is it possible to pass a -y or -all here?


Already there

KILL "*.txt",all

will prompt once only

  Quote   Please create the possibility for security to enable/disable TFTP from the PicoMite side.


I'll see what is possible - no promises
Edited 2023-03-28 07:55 by matherp
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6102
Posted: 10:01pm 27 Mar 2023
Copy link to clipboard 
Print this post

  Quote  Please create the possibility for security to enable/disable TFTP from the PicoMite side.

Provided you don't open up the TFTP port (udp 69) in your router, it can only be used within your local network so is safe from the bad world, but not safe from your own mistakes.

Jim
VK7JH
MMedit   MMBasic Help
 
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 351
Posted: 06:59am 28 Mar 2023
Copy link to clipboard 
Print this post

  matherp said  
Already there

KILL "*.txt",all

will prompt once only


Hello Peter,

good to know. I had a look in the manual beforehand.
This should be added there. A task for @Geoff?!

page 19:
KILL fname$
Delete a file in the current directory on the current drive.

and see picture:





Nice that you check if TFTP can be enabled/disabled.
How will the weather be the next days? ;-)

By the way, are you planning a version of PicoMiteWeb with VGA? That would open up a lot of new possibilities! :-) Would this be possible at all?


  TassyJim said  Provided you don't open up the TFTP port (udp 69) in your router, it can only be used within your local network so is safe from the bad world, but not safe from your own mistakes.
Jim

@Jim: You are right when you are alone in your own WLAN. But with three kids and friends the world looks different. And I think the PicoMiteWeb deserves to be used in cool projects. I'm thinking about sports club and community. And now, at the latest, it needs a certain level of protection.

Matthias
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3816
Posted: 08:08am 28 Mar 2023
Copy link to clipboard 
Print this post

Sounds like a good use for paired Picos (one W, one VGA).

John
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 08:33am 28 Mar 2023
Copy link to clipboard 
Print this post

  Quote  By the way, are you planning a version of PicoMiteWeb with VGA?

No - not enough memory to be worthwhile

  Quote  And now, at the latest, it needs a certain level of protection.


I will include OPTION TFTP ON/OFF in the next release. This will be a permanent option used at the command line only - default will be ON. It is not realistic to allow this in programs as it is not possible to be sure that all memory is released when you attempt to disable web functions
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6814
Posted: 09:09am 28 Mar 2023
Copy link to clipboard 
Print this post

I just happen to know of a PCB for a Pear of PicoMites, John... ;)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3816
Posted: 10:39am 28 Mar 2023
Copy link to clipboard 
Print this post

  Mixtel90 said  I just happen to know of a PCB for a Pear of PicoMites, John... ;)

Hehe I thought so!

John
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 11:37am 30 Mar 2023
Copy link to clipboard 
Print this post

PicoMiteWeb now in beta.

https://geoffg.net/Downloads/picomite/PicoMite_Beta.zip

Minor change

WEB TLS CLINT REQUEST now takes an extra optional parameter

WEB TLS REQUEST request$, array%() [,timeout] [,sendheader]


sendheader can be 0 or 1 and defaults to 1
Setting sendheader to 0 blocks the construction of a standard HTML request to the end of your data (request$)
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3152
Posted: 02:58pm 03 Apr 2023
Copy link to clipboard 
Print this post

Not sure where to put this, but with PicoMite MMBasic Version 5.07.07b34, when I try "OPTON KEYBOARD US" I get "Error : Option System I2C not set".

PicoMite MMBasic Version 5.07.07b34
Copyright 2011-2023 Geoff Graham
Copyright 2016-2023 Peter Mather

> option keyboard us
Error : Option System I2C not set
> option list
PicoMite MMBasic Version 5.07.07b34
OPTION SYSTEM SPI GP2,GP3,GP4
OPTION LCDPANEL ILI9488, LANDSCAPE,GP20,GP19,GP18
OPTION TOUCH GP21,GP22
GUI CALIBRATE 0, 3950, 3882, -1244, -859


Is it supposed to be the case that System I2C must be set for OPTION KEYBOARD to be used?
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 03:31pm 03 Apr 2023
Copy link to clipboard 
Print this post

Will fix
 
bigfix
Senior Member

Joined: 20/02/2014
Location: Austria
Posts: 128
Posted: 06:22pm 03 Apr 2023
Copy link to clipboard 
Print this post

As you solved all the really challenging issues...

May I ask again for the boring feature of fixed IP Addresses ?

Default at initial boot or casual use should stay at DHCP
But it should be possible to override
IP Address, Subnet, Gateway
with an optional config option

This would really help in many situations !
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 06:34pm 03 Apr 2023
Copy link to clipboard 
Print this post

  Quote  May I ask again for the boring feature of fixed IP Addresses ?


No: sorry. Easy enough to set in your router so work for the sake of it and none-trivial in the firmware - there isn't any example code
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3816
Posted: 10:29pm 03 Apr 2023
Copy link to clipboard 
Print this post

  bigfix said  May I ask again for the boring feature of fixed IP Addresses ?

This would really help in many situations !

What are these many situations? I'm puzzled!

John
 
pwillard
Senior Member

Joined: 07/06/2022
Location: United States
Posts: 292
Posted: 12:23am 04 Apr 2023
Copy link to clipboard 
Print this post

  Quote  No: sorry. Easy enough to set in your router so work for the sake of it and none-trivial in the firmware - there isn't any example code


I only do this on my router... none of my devices have been hardcoded with Static IPs and my router knows all of their MAC addresses. Each gets assigned a known IP based on the known MAC. I currently have 35 active devices.
Edited 2023-04-04 10:24 by pwillard
 
bigfix
Senior Member

Joined: 20/02/2014
Location: Austria
Posts: 128
Posted: 08:32pm 04 Apr 2023
Copy link to clipboard 
Print this post

  Quote  What are these many situations? I'm puzzled!

John



I fully respect Peters reasoning - and will not bother him any longer !

But as the question came up - here are my reasons for static IP


I have quite a few IP devices - my Class C subnet is getting full...

To keep things organized, I have a small DHCP pool and mostly fixed IPs
Longerterm I will implement multiple VLANS/SSID and filtering between them




Why do I use fixed IP Addresses ?

I usually keep a preconfigured spare unit for each important device
If something fails (usually at the worst moment...) it is just a quick swapout
There is no easy way to have two MAC addresses pointing to the same IP address in the router

If I would use a spare WebMite for multiple applications, it has the same MAC address,
(independent from the application)
When I flash some app, I would also need to modify the DHCP config accordingly


I also keep a preconfigured spare router
If I add a new DHCP device to the current router, I would need to update the spare

If I change to another type of router,
I would need to reenter all the DHCP entries into the new router

I have multiple DSL lines - with manual config I can select the right router
There is no easy way to do this with DHCP

So far EVERY device I use has an option for fixed IP addresses
Some are easy, some are rather challenging - but doable

I would like to use WebMites, but DHCP only does not fit to my environment
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3816
Posted: 10:27pm 04 Apr 2023
Copy link to clipboard 
Print this post

Fascinating.

I've never had any of the kinds of devices you mention fail (*) so I guess either I'm very lucky or you're rather unlucky...

(*) oh, how to tempt fate!

John
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 09:27am 05 Apr 2023
Copy link to clipboard 
Print this post

FYI, I've just posted a question about this on the Pico forum and static IP addresses are not supported at all by the current RP2040 sdk so even if I wanted to.....
 
bigfix
Senior Member

Joined: 20/02/2014
Location: Austria
Posts: 128
Posted: 08:34pm 06 Apr 2023
Copy link to clipboard 
Print this post

  Quote  FYI, I've just posted a question about this on the Pico forum and static IP addresses are not supported at all by the current RP2040 sdk so even if I wanted to.....


Strange, at least CircuitPython seems to support it - different SDK ??
CircuitPython Example



  Quote  I've never had any of the kinds of devices you mention fail (*) so I guess either I'm very lucky or you're rather unlucky...


I have quite a few failures - but to be fair, most are in PSU sections

If a light actor has a electrolytic capacitor for 240v in the size of a pea,
you can bet that it fails after a few years...

MLCC capacitors seem to develop shorts recently, i.e. in routers

Current self healing X2 Capacitors loose their capacitance really quick
Older types last since 30+ years i.e. in my ancient X-10 actors

And soon thunderstorm season is coming - then anything can get barbecued...
 
pwillard
Senior Member

Joined: 07/06/2022
Location: United States
Posts: 292
Posted: 11:32pm 06 Apr 2023
Copy link to clipboard 
Print this post

I dunno. I find assigning static IP's to be a pain.
 
     Page 1 of 2    
Print this page
© JAQ Software 2024