M4Board - accessed by web UI - networking crashes

Started by bart71, 10:53, 03 August 23

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bart71

Hello
This is my first post here (not counting introduction in general section :) )
I have recently bought a used M4Board - rev. 2.5C - 2019
It works OK on my CPC6128 until I try accessing it using http using external computer.
I have upgraded it to the recent version - 2.0.7
All stuff which I run from CPC work OK - I can use DSK images with no problems, httpget etc.
Every attempt of accessing web UI makes networking crash:
|netstat results in: "Unknown status 255". 
After rebooting M4 - networking is OK again - but only until first http access attempt.
Client computer (tried different browsers) only sometimes shows a bit of blue start page with links to files, roms, config. 
I have tried to clean SD card, tried also downgrading to 2.0.6 and back to 2.0.7.
Any suggestions on further troubleshooting???

pelrun

M4 crashes are almost universally due to insufficient power. Wifi can pull a lot of instantaneous current, and if there's too much resistance at any point in the circuit then you'll get a sudden voltage drop which can screw the system up.

So first, make sure your PSU is up to the task. It'll need a 2A or better rating. If it already does, then there's no point going higher, the problem is elsewhere.

Clean your connectors - both the edge connector and the power jack/socket. I went so far as to replace the 5v socket on my CPC, but that's not something everyone is comfortable with.

Unfortunately none of that was sufficient in my case (both 6128's I have a significant resistance between the input and the internal voltage rail I've never tracked down), so I needed to increase the input voltage to compensate. Either a higher voltage PSU (the old micro-usb raspberry pi power bricks are 5.1v for this exact reason), or I actually opened up my monitor and adjusted the 5v output pot to give me 5.3v - which gave me a rock-solid system. Don't go any higher than that, though!

bart71

Thanks, it can be a good point.
I do not have Amstrad monitor, use 5V power supply giving max 2A - so may not be sufficient for CPC + M4. Will try to power it up from USB (yes, I need to move the jumper)
......... after a while .....
Have tried powering M4 from external 5V PSU
Unfortunately SAME result :-(


pelrun

Adding external USB power to the M4 made *zero difference* in my case, which is why I didn't bother mentioning it. Maybe you'll be lucky.

Honestly a good 2A supply should be perfectly sufficient, but proving you have a good one is difficult. It's also useful to check the internal power rail (e.g. using a multimeter to measure the voltage between the 5v and GND pins on the Z80) to get an idea of how much voltage drop is already present in your system.

GUNHED

Can you give a precise step-by-step description (including all http addresses, files, etc.) to produce the error / problem. 

This way I can try to reproduce it. And maybe help.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

bart71

First of all - I bought a used M4board which was configured for 464 and in addition had a French keyboard layout - was very difficult to do anything - so what I did:

- cleaned SD card
- downloaded recent firmware: 2.0.7, unzipped and placed on SD. It has been installed properly, unfortunately I still had French layout
- downloaded 6128 lower rom from https://www.cpcwiki.eu/index.php/M4_Board following file https://www.cpcwiki.eu/imgs/4/43/M4LOW-EN.BIN and I ran it from CPC. From now on everything what I run from CPC keyboard is working correctly
- have setup networking: |netset,"name=AMSTRAD, ssid=....., pw=...., dhcp=1, dns1=1.1.1.1, dns2=8.8.8.8
- config.txt is created in "m4" directory so networking works after reboot
- networking things work normally ok like e.g |netstat, |upgrade or |httpget,"spinpoint.org/battro.dsk (file downloads and runs OK)

Problems start when I try to access CPC from external computer:
- from Chrome (or any other browser) I open url: http:/<CPC_IP> - and M4 board looses networking - |netstat shows "Unknown status 255"
- page sometimes manages to display (very rarely) so I see links: Files, Roms, Control, Configuration
- networking is back on the reboot and is stable - untill I try to access CPC from external computer ...

this is a complete scenario
problems seem to be with embeded http server application?? Can I force-flash it somehow? Is there anything like "factory reset" for the board???

when I run |m4help I see: "M4 BOARD" in slot 6 and "CPM ROM" in slot 7, all other entries show "BASIC"


any help appreciated 

GUNHED

Well, this phenomenon sometimes comes up if the network is weak.

Using the NETSTAT, how much strength does it show?

Try this Please: Move the CPC (with M4 card) and the PC closer (1-5 meters) to the WiFi-Box. And try it all again.

The CPC's M4 network antenna has a bit a shorter range than the PC Wifi cards usually have (that't great for our health, but not helpful in this case).
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

bart71

Thanks a lot for lots of good suggestions.
When it comes to signal strength - it is very good - I am like 2meters away from the AP.
Also file transfer via |httpget is very stable so it is not the case.
It must be something else - embeded http server makes IP stack to crash ...
... still very very grateful for all suggestions  ;D

Bart

pelrun

Quote from: GUNHED on 22:30, 03 August 23Well, this phenomenon sometimes comes up if the network is weak.

Which is just another way of saying "you have insufficient power".

Wifi chipsets have automatic transmit power control; they use the minimum output power needed for a solid connection. If the signal from the AP is weak then they crank up the power to compensate. High transmit power + insufficient input power = voltage drop = crash. Moving your M4 closer to the AP is simply covering up the problem, not fixing it.

I need to repeat what I said in my first post - spurious M4 crashes are basically *always* due to insufficient power.

The M4 has multiple components, which draw varying amounts of power for different operations. Bringing up the webpage can cause the M4 to do a lot of work reading the SD card and generating the page, in addition to the wifi draw. All it takes is 100ms where everything wants power at once and you're in trouble, and that is too fast to show on a multimeter.

GUNHED

Quote from: pelrun on 20:00, 04 August 23
Quote from: GUNHED on 22:30, 03 August 23Well, this phenomenon sometimes comes up if the network is weak.
No. Antennas have maximum range when powered at maximum and also maximum penetration. These are natural laws. The range depends primarily on the wavelength and the resistance to be overcome.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

bart71

Will try with oscilloscope to check if there is any voltage drop when I try to access web UI.
But as I said earlier - |httpget file transfers seem to be stable ...

GUNHED

How big is the distance between M4 and WiFi-Router? Are there walls in between?
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

bart71

No walls, AP is approx 2m away, it is a good one, maybe some interference from other equipment??  I will experiment more tomorrow with moving stuff arround.....
Oscilloscope should confirm/deny voltage drop theory....
Thanks a lot for your engagement, appreciate it very very much. 

pelrun

Quote from: GUNHED on 20:11, 04 August 23No. Antennas have maximum range when powered at maximum and also maximum penetration. These are natural laws. The range depends primarily on the wavelength and the resistance to be overcome.

Yes. And?

I might be able to hear you when you're shouting at full volume directly into my ear, but you'll burst my eardrum and I'll punch you in the nose. People don't walk around TRYING TO GET MAXIMUM RANGE ALL THE TIME BY SCREAMING EVERY WORD AT THE TOP OF THEIR LUNGS.

Ahem. They choose a volume appropriate for the situation, just like modern wifi transceivers do. As I already literally said "they use the *minimum* output power required for a good connection".

Going full blast when the AP is right next to you produces *worse* outcomes, overloading the receiver hardware and making the signal-to-noise ratio extremely low. So modern transceivers don't do that. Again, they dynamically adjust their transmit power as needed. A close/strong AP will result in low transmit power on both sides, and a distant/weak/deaf AP will result in high transmit power being selected.

pelrun

#14
Quote from: bart71 on 20:13, 04 August 23But as I said earlier - |httpget file transfers seem to be stable ...

And as I said, different operations have different power profiles. |HTTPGET barely uses the transmitter at all, the bulk of the transfer is done by the receiver which is far less power-hungry. Requesting the M4 webpage means it has to power the transmitter to send a large block of data over a long period of time, while also potentially doing a bunch of SD-card operations to retrieve and parse the file system directory.

bart71

Quote from: pelrun on 21:37, 04 August 23
Quote from: bart71 on 20:13, 04 August 23But as I said earlier - |httpget file transfers seem to be stable ...

And as I said, different operations have different power profiles. |HTTPGET barely uses the transmitter at all, the bulk of the transfer is done by the receiver which is far less power-hungry. Requesting the M4 webpage means it has to power the transmitter to send a large block of data over a long period of time, while also potentially doing a bunch of SD-card operations to retrieve and parse the file system directory.
And as I said, I will use oscilloscope tomorrow to see if voltage drops down or not   :D :D :D

bart71

It took a bit longer to check it but finally have done it. Connected oscilloscope to check things and no voltage drop. Tried continuous mode and triggered as well - voltage stays stable. Got some comments from Duke, most probably the problem is with the  Wifi module itself.

Powered by SMFPacks Menu Editor Mod