Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 21:05 12 Jul 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 : tcp/udp string lengths

Author Message
Malibu
Senior Member

Joined: 07/07/2018
Location: Australia
Posts: 260
Posted: 05:24am 14 Dec 2024
Copy link to clipboard 
Print this post

One for @MatherP to answer I would think...

I'm playing around with UDP at the moment, connected to some simple code using PureBasic (I've just started trying to learn it)
Type a message in the console, hit enter and the message gets sent to the WebMite by UDP to be processed.

Everyting works fine, but I wondered why the MM.MESSAGE$ is limited to a 255 byte string?
Might it be better to define it as a LongString, similar to TCP data... or is it even possible?

And maybe a feature request for a couple of new variables
MM.INFO(TCP PORT)
MM.INFO(UDP PORT)
that can be used to check what the port numbers are allocated for TCP/UDP
John
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7869
Posted: 08:13am 14 Dec 2024
Copy link to clipboard 
Print this post

Geoff's demo program in the Webmite manual does exactly this, using a LongString for the data.

Didn't you define the port numbers as OPTIONs so you know them anyway? :)
Mick

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

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3285
Posted: 08:26am 14 Dec 2024
Copy link to clipboard 
Print this post

There is no demo of UDP in the manual, are you thinking of the TCP client?

Geoff
Geoff Graham - http://geoffg.net
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10244
Posted: 08:36am 14 Dec 2024
Copy link to clipboard 
Print this post

  Quote  Everyting works fine, but I wondered why the MM.MESSAGE$ is limited to a 255 byte string?

As soon as you create a UDP server the code must have somewhere to put an incoming message even if your code isn't yet running. The way it does this is to automatically create a MMBasic variable MM.MESSAGE$. It makes no sense to automatically create a longstring - how big should it be?
The 255 byte size of MM.MESSAGE$ is a limitation that you have to work with.
I can add the extra MM.INFO( functions but this comes into the category of others I have begrudgingly added - "You set it - so you should already know what it is!!!"
Geoff: a simple UDP example may be worth adding to the manual. I'll post a simple UDP loopback on the manual thread
Edited 2024-12-14 18:38 by matherp
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7869
Posted: 09:28am 14 Dec 2024
Copy link to clipboard 
Print this post

Sorry Geoff, yes, it's TCP.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Malibu
Senior Member

Joined: 07/07/2018
Location: Australia
Posts: 260
Posted: 07:42am 28 Dec 2024
Copy link to clipboard 
Print this post

I've been fooling around with the UDP in WebMite lately and wrote some code in TwinBasic that might help some others to test UDP functionality.

Disclaimers :
1) It's my first time using TwinBasic and according the blurbs, there's no RunTime necessary (like VB6 needs) so it SHOULD run 'as is' as a stand-alone .EXE
I don't know if that's true, so if you have any problems running it, please let me know
2) It's a windows app. It's also a 32bit version. Sorry, that's all my TwinBasic version will allow me to do.
3) It's dirty.... very little error traps, it makes a few assumptions and it doesn't ALWAYS work how my mind thinks it should.

Anyway, here's a screen shot

... and the files if there's an interest to try it out

UDP Test.zip

... consisting of the App, the WebMite code and a ReadMe file
If you would like to install it, you might get windows defender complaining on the first run

Up to you if you want to block it or not  
I presume if you block, the App won't function.

Give it a crack, see if it's an option for anyone doing WebMite code. It might be helpfull if you're just looking to send simple commands via WiFi

As a post note, anyone (like me) that's entrenched in VB6, TwinBasic seems to be a great modern-day alternative  
Edited 2024-12-28 17:42 by Malibu
John
 
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 467
Posted: 10:45am 28 Dec 2024
Copy link to clipboard 
Print this post

Hi John,

Good learning. I didn't even know about twinbasic. It sounds really interesting. I looked at your zip, it also contains the mmbasic part. Would you release the twinbasic part as well? Thank you very much.

Matthias
 
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