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 : Udp to the WwW?
Author | Message | ||||
Plasmamac Guru Joined: 31/01/2019 Location: GermanyPosts: 554 |
Hi, ive testet the webmite udp with a ip adress outside my homenetwork. No success atm. Have anyone tested this also? Plasma |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6798 |
Will your router pass UDP? I don't think they are normally set up to do so by default as it can be a security risk. They normally won't accept UDP connections from outside. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6100 |
try sending a UDP message to tassyjim.ddns.net port 6802 It only accepts messages one at a time. I will add some logging later. It is also running on a part of my network I don't normally expose so it will not be there for long. That's going trough two NATs Jim Edited 2023-06-02 17:37 by TassyJim VK7JH MMedit MMBasic Help |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6100 |
I have now put a WEBmite on the net. It is running a slightly modified version of Peters example. ' OPTION EXPLICIT OPTION DEFAULT INTEGER DIM remoteIP$, n, lastTime$ WEB UDP INTERRUPT myUDPint 'WEB UDP SEND "tassyjim.ddns.net", 6802, "Hello world" DO LOOP UNTIL n > 100 SUB myUDPint PRINT "received "+MM.MESSAGE$+" from "+MM.ADDRESS$+" at "+TIME$ IF remoteIP$ = MM.ADDRESS$ AND LEFT$(lasttime$,5) = LEFT$(TIME$,5) THEN INC n ELSE remoteIP$ = MM.ADDRESS$ lastTime$ = TIME$ n = 1 ENDIF IF n < 10 AND LEN(MM.MESSAGE$) < 200 THEN WEB UDP SEND MM.ADDRESS$,6802,MM.MESSAGE$+" at "+TIME$ ENDIF END SUB The biggest risk with having a simple server on the net is how easy it would be to end up with a race condition where a message gets bounced back and forth eating up all your bandwidth and eventually getting banned by your ISP. The above code should limit a user to 10 hits in any minute. Not very sophisticated and I will do more but it would be silly announcing the code. That would make it too easy for anyone wanting to play silly games. Code at the other end is: ' OPTION EXPLICIT OPTION DEFAULT INTEGER WEB UDP INTERRUPT myUDPint WEB UDP SEND "tassyjim.ddns.net", 6802, "Hello world" DO LOOP SUB myUDPint PRINT "received "+MM.MESSAGE$+" from "+MM.ADDRESS$+" at "+TIME$ END SUB It just sends one packet and prints the reply. This will test your router to see if it has port triggering or port forwarding set up. Jim VK7JH MMedit MMBasic Help |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6100 |
Did you get the reply? (Local time which is 02:17 UTC) Jim Edited 2023-06-03 12:21 by TassyJim VK7JH MMedit MMBasic Help |
||||
Plasmamac Guru Joined: 31/01/2019 Location: GermanyPosts: 554 |
No reply Plasma |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6100 |
I received plenty of packets and when I tested it, I was receiving replies OK. The replies are sent to your public IP port 6802 so it looks like you need to check your router port forwarding That's the trouble with UDP, not easy to know if it works. Edit: I can't ping the 92.xxx.xxx.xxx address and a trace gets lost in telefonica.de Jim Edited 2023-06-03 15:42 by TassyJim VK7JH MMedit MMBasic Help |
||||
Plasmamac Guru Joined: 31/01/2019 Location: GermanyPosts: 554 |
Hmm i forwarded the range 6800-8888 to the ip from the mite , dunno why nothing works. Sorry for flooding, next tests tonight I totally forget to check the ping 😵💫 omg Plasma |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6100 |
UDP not TCP? Jim VK7JH MMedit MMBasic Help |
||||
Plasmamac Guru Joined: 31/01/2019 Location: GermanyPosts: 554 |
Udp yes Plasma |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6100 |
The WEBmite UDP server is back up again. Next silly question. You do have the server set in options? OPTION UDP SERVER PORT 6802 Also, Many ISPs use CGNAT (Commercial Grade NAT) to save on IP addresses. In Australia Telstra mobile network is one example. Can you check you WAN IP as reported by your router and advise the first part only. If it starts with '92.' it looks like a true public ip but starting with '100.' and it indicates CGNAT. There will be other CGNAT ranges. Some ISPs block all incoming ports unless you request them being opened. Opening the range 6800-8888 is excessive and I suggest just forwarding what is required. Apart from that, I have run out of ideas. Jim VK7JH MMedit MMBasic Help |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6100 |
VK7JH MMedit MMBasic Help |
||||
Plasmamac Guru Joined: 31/01/2019 Location: GermanyPosts: 554 |
HI Tassyjim it works ! got reply from your server . i reboot the router and all fine now. i will now check the runtime if you have nothing against 480 ms atm . Edited 2023-06-04 07:33 by Plasmamac Plasma |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6100 |
Good to see it working. I noticed that your IP has changed. That means you are on a dynamic IP like most users. That is not a problem. Jim VK7JH MMedit MMBasic Help |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6100 |
You exceeded 10 in a minute so it stopped replying and after 100 in an hour, the system shuts down and needs a manual re-start. A bit crude but offers some protection from a wrongly programmed pico going astray. Jim VK7JH MMedit MMBasic Help |
||||
Plasmamac Guru Joined: 31/01/2019 Location: GermanyPosts: 554 |
Yup sry for this, a speedtest Plasma |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6100 |
Don't be sorry, it all helps me refine the protection. It now has a limit of 20 per minute and will restart at the next hour if you overload it too much. I have plenty of bandwidth. Jim VK7JH MMedit MMBasic Help |
||||
Plasmamac Guru Joined: 31/01/2019 Location: GermanyPosts: 554 |
ok will check Plasma |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6100 |
I have shut the echo program down. I needed the pico for a real job. Jim VK7JH MMedit MMBasic Help |
||||
Plasmamac Guru Joined: 31/01/2019 Location: GermanyPosts: 554 |
np Plasma |
||||
Print this page |