News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Duke

Amstrad CPC WiFi

Started by Duke, 07:36, 07 May 16

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

RobertM

Hi,

My M4 board just arrived recently and it's a terrific little board but I have some slight issues.

From the CPC side it works perfectly with only one glitch and that is it won't work from external 5V. I am using in straight into the expansion port and that works fine. I previously added a wire inside the CPC6128 from internal 5 Volts to the 5 Volt edge connector due to voltage drop issues with another project. The fact the is doesn't work with my external 5Volts supply (USB plugpack wallwart) is probably just a faulty power supply.

The real problem is with the WiFi http server. I have M4 and ESP8266 Version 2.0.3 and it connects to the local access point with no trouble (I disabled encryption - can the M4 work with encryption?).

When I connect using a PC and browser the pages time out with a message that server reset the connection. HOWEVER if I hit the cross button to stop the page download before it times out I can see that the page has loaded - apparently completely.

I used a header sniffer and I noticed the server is responding HTTP 1.0 rather than HTTP 1.1
I don't have software here at the moment to view the server response as one file including header and response.

MY memory of the HTTP standard is a little rusty so this is what I was thinking -

I seem to remember that HTTP 1.0 had to respond with an extra header Content-Length: and if that is not calculated correctly the connection will hang and then time out.

Like this -
HTTP/1.0 200 OK\r\nContent Lenght: xxx\r\n\r\ncontent goes here
Where the double \r\n (\r\n\r\n) is the division between header and content
From memory this became optional with 1.1 but you had to add a double \r\n at the end
HTTP/1.1 200 OK\r\n\r\ncontent goes here\r\n\r\n
I went looking for the source to try the changes. I also noticed some html errors in the shmtl (SSI) code as well that I want to fix up but I can't find the source and I would probably have trouble recompiling it as I haven't worked with this ARM chip before.

I see that the Content-Length: is still included in HTTP1.1 so perhaps the best solution is to have a correct content length response and one \r\n at the end of the content.

Perhaps I should just set up a php server here and use a url in fileGetContents() to see the complete data transaction but then I sill don't know where the code is or how to re-compile the source.

Any tips / suggestions would be appreciated.


Duke

#1576
Quote from: RobertM on 02:14, 15 June 17
The real problem is with the WiFi http server. I have M4 and ESP8266 Version 2.0.3 and it connects to the local access point with no trouble (I disabled encryption - can the M4 work with encryption?).
It supports encryption, wep/wpa/wpa2.
Quote
When I connect using a PC and browser the pages time out with a message that server reset the connection. HOWEVER if I hit the cross button to stop the page download before it times out I can see that the page has loaded - apparently completely.
Afaik. Content-length is not obligatory for HTTP 1.0. *EDIT* Actually you may be right or "Otherwise, the body length is determined by the closing of the connection by the server." from https://www.w3.org/Protocols/HTTP/1.0/spec.html#BodyLength

Guess it may be up to the browser implementation, from what I know firefox, chrome and IE have no problems with the web server.
What browser are you using?

One thing that may an issue, is if you use a slow microSD card and have lot of files on it, when using the "file browser". A class-10 or better microSD is a plus. A weak WiFi signal may be at cause too, have you checked signal value with |netstat?
Quote
I went looking for the source to try the changes. I also noticed some html errors in the shmtl (SSI) code as well that I want to fix up but I can't find the source and I would probably have trouble recompiling it as I haven't worked with this ARM chip before.
I have not released the source for the ARM mcu nor the ESP. Only the Z80 part (https://github.com/M4Duke/)
You can use the microSD to host the webserver, rather than the build in FS I made into the ESP flash.
It can be accessed by adding /sd to the IP, ie. http://192.168.1.10/sd/index.shtml  or whatever (all links should have /sd). If you want I can upload the web pages somewhere, if you want to modify them.
If you find any errors in the shtml, I'll be happy to include them with the next firmware update.

Lastly, your M4 was shipped with v2.0.3 beta (that goes for any M4 board shipped before 2017-06-06, that states v2.0.3). I suggest you update it to the release version v2.0.3 as it has some fixes. You can download it here:
http://www.cpcwiki.eu/index.php/M4_Board

radu14m

#1577
Quote from: Duke on 20:10, 11 June 17
Signal seems fine. Not sure what the problem is. Is the slowdown when you access the web interface or when you download something?
Maybe you have a network IP conflict. You could try to use DHCP option to see if it disappears?
Some other user reported if I remember correctly that norton firewall was blocking access to the web interface, so maybe if you have some kind of fw/antivirus running on the PC, you may need to add an exception.



i did not manage to solve it.
i have avg,and i add the exception to the adress: http://cpc6128/
also i set a fixed IP adress, hdcp=0.


what is wrong ?

Duke

Quote from: radu14m on 07:37, 18 June 17

i did not manage to solve it.
i have avg,and i add the exception to the adress: http://cpc6128/
also i set a fixed IP adress, hdcp=0.


what is wrong ?
As I said earlier:
Is the slowdown when you access the web interface or when you download something?
Maybe you have a network IP conflict. You could try to use DHCP option to see if it disappears?

Sorry,  I don't stand much chance to solve your problem with the info's given. What is it that is slow and takes minutes to complete?
What browser are you using? have you tried disabling avg? etc.

radu14m

the slowdown is always, when accesing the cpc from pc via google chrome, when change the m4 settings or when a file is downloaded.
no network ip conflict is present, as i have only the cpc connected.
dhcp option does not change the time acces.


it takes about 3-5 min to load the page from cpc.
i disable the avg, no difference.
im out of ideeas, what caould it be.


thanks Duke !

Duke

#1580
Update!
Firmware v2.0.4 beta 1. Get it here: http://www.spinpoint.org/cpc/M4FIRM_v204b1.zip

This is very beta / experimental and might contain bugs :)

Two new commands, this is for CPC PLUS users only (I have only CPC6128+, so CPC464+ is untested).

|CTRUP,"filename.cpr" 
Uploads a CPC+ cartridge image into M4 flash. Max. used size is 256KB (is there any bigger than 128KB?)

|CTR
Executes whatever cartridge image that is uploaded to flash.

Mostly I think this will be useful for developers of CPC+ cartridge games, as you can remotely upload and run carts, so quick for testing.

How ?

First create a basic file on the microSD, that does:
10 |CTR

save"autoexec.bas"

Now use the cpc xfer tool (http://cpcwiki.eu/index.php/CPC_M4_xfer_tool):

Upload the file

xfer -u ipaddr ctrfile.bin / 0

The file can be either plain binary or cpr format, but filename must be "ctrfile.bin"

xfer -r ipaddr

Reset to flash the image, once done autoexec.bas will run.

Maybe I will make another method to do remote upload/running, if anyone is going to need it.

Short vid, showing the uploading and launching of a few games.



@radu14m: Sorry I didn't notice your reply until now, when I made a new post.
I have no idea what the problem is. I haven't heard about it before. Has it been like this since you got it? - Also have you tried to use another computer to access the web interface, ie. use a smartphone, to see if the problem is the same?

dragon

#1581
Yes, probably the New made with last nocart versión are all 512kb + probably some i made with a custom loader for levels. But i don't know who are.





Also my cartridge with all operating systems. Buts It the same.

VincentGR

Got mine, a friend bough for one for me too.
I will have access in late September  :picard:

Duke

Quote from: dragon on 21:12, 22 June 17
Yes, probably the New made with last nocart versión are all 512kb + probably some i made with a custom loader for levels. But i don't know who are.
Also my cartridge with all operating systems. Buts It the same.

Ok, thanks, I was thinking of native CPC plus games (that makes use of RMR2), converted CPR games, should work if you just use |cd,"whatever.cpr", unless it uses a particular modified disk rom. I guess if anyone finds it useful I could make switch in the webui, that allocates the last 16 regular roms to the cartridge 256 KB part, bringing it to a 512KB total.

krusty_benediction

For the lazy guyz who want to type less on their CPC, I have started bndsh which is a ROM that adds functionalities to the BASIC prompt.
It is not finished, there are still some bugs and my investment on the project will depend on the feedback of users (if there are users) and my own usage of my CPC.

The main functionalities of interest for CPC Wifi owner are the ability
- to go inside folders with a unix like syntax and not an RSX syntax (i.e cd myfolder instead of |cd,"myfolder)
- to run a program only by typing its name (i.e. myprog.ram instead of run"myprog.ram)
- to autocomplete folders/filename with TAB key

The current version uses extra memory, I have no idea how it reacts on a CPC with 64 or 128Kb of memory (I am pretty sure it writes in the memory bank accessible with 0xc0)

The ROM is here: https://github.com/rgiot/bndsh/blob/master/BNDSH.ROM
The manual is here: https://github.com/rgiot/bndsh
Feel free to use the issue tracker https://github.com/rgiot/bndsh/issues to post bugs (even those I know) or modification requests
fee free to propose pull requests to fix bugs or add functionalities; the software will improve faster as I plan to focus my coding time to other CPC projects

Joseman

Quote from: krusty_benediction on 16:57, 23 June 17
my investment on the project will depend on the feedback of users (if there are users) and my own usage of my CPC.


Of course a rom of this type is very useful for users of the M4!!

You have all my feedback possible BUT, this months i'm out of home, only job until september.

I'll not have time to test the rom or give you any feedback, but i'll follow this project closely!


00WReX

#1586
Only had time for a quick test, and it was a bit 'hit & miss'.
Some games appear to be OK.
But Burnin Rubber goes to a blank screen when you select 1 to play.
Panza kick boxing has some strange screen flashing behaviour.
Erratic behaiour with Navy seals.
All a bit strange.
They all appear to initially load OK (title screen).

I copied my .CPR files directly from the C4CPC.

Tested on an AZERTY 6128 Plus and a QWERTY 464 Plus

Standard 'Plus' cart and M4 with no lower ROM enabled.

Seems to have even corrupted the couple of ROM games I had installed on the M4.

I can't narrow it down at the moment. Hmmm.
Everything else works fine from the M4 just as it did on fw 2.0.3

Looks like the flash never gets cleaned even with a fw upgrade/downgrade as after this I can still immediately hit |ctr and load the game.
This itself seems to have caused some issues with corruption, and some strange power on screen flashes.


Cheers,
Shane
The CPC in Australia...
Awa - CPCWiki

Duke

Quote from: 00WReX on 05:19, 24 June 17
Only had time for a quick test, and it was a bit 'hit & miss'.
Some games appear to be OK.
But Burnin Rubber goes to a blank screen when you select 1 to play.
Panza kick boxing has some strange screen flashing behaviour.
Erratic behaiour with Navy seals.
All a bit strange.
They all appear to initially load OK (title screen).

I copied my .CPR files directly from the C4CPC.

Tested on an AZERTY 6128 Plus and a QWERTY 464 Plus

Standard 'Plus' cart and M4 with no lower ROM enabled.

Seems to have even corrupted the couple of ROM games I had installed on the M4.

I can't narrow it down at the moment. Hmmm.
Everything else works fine from the M4 just as it did on fw 2.0.3

Thanks for the feedback. I tested with the dumps from here: http://www.cpcmania.com/GX4000-Games/Games.htm
Maybe it could be a format problem (if those work for you too?). They are all 128KB in size only.

I will have to test it some more myself, if it corrupts your other roms there is clearly a bug in my code.

Quote
Looks like the flash never gets cleaned even with a fw upgrade/downgrade as after this I can still immediately hit |ctr and load the game.
This itself seems to have caused some issues with corruption, and some strange power on screen flashes.

That's correct. The 256KB of flash I use for the cartridges was not used before (nor erased).

KaosOverride

Great work supporting real .CPR!!!


Is the M4 mirroring the roms? 128kb ones looks like are 4 times repeated as a full 512kb. 256 also repeating 2 times. Don't know if the Basic and Amsdos mirror is also mandatory for the cartridges working fine...
KaosOverride · GitHub
MEGA Amstrad Public Amstrad folder

Duke

Quote from: KaosOverride on 09:00, 24 June 17
Great work supporting real .CPR!!!


Is the M4 mirroring the roms? 128kb ones looks like are 4 times repeated as a full 512kb. 256 also repeating 2 times. Don't know if the Basic and Amsdos mirror is also mandatory for the cartridges working fine...
Thanks. Actually I don't setup any mirrors, though that would be easy to add.

CraigsBar

#1590
Hmmm. Looks like you are all having more success than me. I cannot get any game to load. Just this sort of crap....
[/url]

Sent from my ONEPLUS 3t using Tapatalk
IRC:  #Retro4All on Freenode

CraigsBar

On a happier note however the Benediction shell rom will live in slot 1, it is amazing :)

With my Patched Cart in the C4CPC I can use c4cpc as a command to open the c4cpc menu and select a cart game so it's pretty damn fine anyway.
IRC:  #Retro4All on Freenode

Duke

Quote from: CraigsBar on 12:06, 24 June 17
Hmmm. Looks like you are all having more success than me. I cannot get any game to load. Just this sort of crap....

https://youtu.be/GPwvcSMRlmA
No idea, other than could it be there is several cpr's in circulation of the same games, for me every game from here works(except plotting, not looked into why yet):
http://www.cpcmania.com/GX4000-Games/Games.htm

I pretty much ignore the headers in the cpr format, so maybe if they are differently formatted (swapping the blocks) it could be the problem.
Anyone else tried it out?

CraigsBar

#1593
OK. I have tried every CPR I can find, 2 different sd cards, 3 different m4 boards and 2 different plus machines. I must be missing something and I have not got a single cpr to run on any of the above multitude of combinations. 🙁

Edit: hopefully I won't be so stupid come the actual release rather than a beta.
IRC:  #Retro4All on Freenode

Duke

Quote from: CraigsBar on 15:26, 24 June 17
OK. I have tried every CPR I can find, 2 different sd cards, 3 different m4 boards and 2 different plus machines. I must be missing something and I have not got a single cpr to run on any of the above multitude of combinations. 🙁

Edit: hopefully I won't be so stupid come the actual release rather than a beta.

Weird stuff. My head is spinning  ??? -  Nah you didn't miss an actual release, there is only one beta so far with this.
Are you using the original "burning rubber with basic and amsdos"-card to boot the CPC+?
And thanks for taking the time to test.

Duke

@00WReX & @CraigsBar

Can you please test http://www.spinpoint.org/cpc/M4FIRM_v204b2.zip   . Hopefully all your problems will disappear... Thanks !

RobertM

Quote from: Duke on 07:19, 15 June 17
It supports encryption, wep/wpa/wpa2.Afaik. Content-length is not obligatory for HTTP 1.0. *EDIT* Actually you may be right or "Otherwise, the body length is determined by the closing of the connection by the server." from https://www.w3.org/Protocols/HTTP/1.0/spec.html#BodyLength
 
I also now remember having to use a header Conection:Keep-alive ro something like that.
QuoteGuess it may be up to the browser implementation, from what I know firefox, chrome and IE have no problems with the web server.
What browser are you using?
I am using DevFox which is based on FireFox and is the latest Build. FireFox (also the latest) had the same issues.

Quote
One thing that may an issue, is if you use a slow microSD card and have lot of files on it, when using the "file browser". A class-10 or better microSD is a plus.
I am using a 32GB class 10 micro sdHC. It's a non-name brand that I haven't speed tested. Perhaps I will speed test it.

Quote
A weak WiFi signal may be at cause too, have you checked signal value with |netstat?
|netstat shows Signal: 0xC6

Quote
I have not released the source for the ARM mcu nor the ESP. Only the Z80 part (https://github.com/M4Duke/)You can use the microSD to host the webserver, rather than the build in FS I made into the ESP flash.
It can be accessed by adding /sd to the IP, ie. http://192.168.1.10/sd/index.shtml  or whatever (all links should have /sd). If you want I can upload the web pages somewhere, if you want to modify them.
If you find any errors in the shtml, I'll be happy to include them with the next firmware update.
Ok I will set up the files on the sd card and experiment. I can add an extra \r\n ad see it that helps

[qoute]
Lastly, your M4 was shipped with v2.0.3 beta (that goes for any M4 board shipped before 2017-06-06, that states v2.0.3). I suggest you update it to the release version v2.0.3 as it has some fixes. You can download it here:
http://www.cpcwiki.eu/index.php/M4_Board
I am not understanding the above. Is there both a version called "2.0.3" and another version called "2.0.3 beta" ?? I will chech the link.
Thank you very much for your response. Is it possible to send the SHTML files to me in a zip?

KaosOverride

As far as I know, there are some different .CPRs of the same game because of:


-Dumping the cart at full addresing, so a 128kb romchip is read as 512kb with repeated blocks
-Carts from the Gx4000 demostrator, which are mostly cutdown versions, like some Pang dumps
-Correct 128kb dump extracting the romchip or manipulating a 512kb dump.


The rom mirrors can give problems if the game uses out of logic tricks to select rom pages. Same as partial IO decoding, using unofficial IO ports because you save some ASM ins...
KaosOverride · GitHub
MEGA Amstrad Public Amstrad folder

00WReX

Thanks Duke.

I just quickly tried Beta 2.

Still hit and miss for me...but...
With the initial beta, Navy seals and Panza kick boxing would fail with a flashing / garbled screen. But now appear to be OK.

I do say 'appear' because I have not played any game much beyond getting into the game and have a quick 'look' around.

With Burnin' Rubber the main screen / menu loads up just fine, and plays the music fine.  But when I start a game, after a few seconds it freezes.
And when it does this even the reset on the M4 board does not work.
I tried it again, and this time it went to a blank screen after pressing fire to start.

Pang does not work, the intro screen is garbled and then it just goes to blank screen. Again the M4 reset button also does nothing.
Trying it again and the initial screen looked ok, but it went to a blank screen a locked up.

Switchblade brings up all the loading screens and intro's fine, then crashes with a garbled screen.

I also downloaded Pang and Burnin' Rubber from CPCmania but the still no go.

The results for those that fail are not consistent either.
Sometimes they fail slightly differently each time...it's almost like some sort of timing issue.

Robocop 2 seems fine.

Fire and Forget 2 seems fine.

No others tested yet.

Cheers,
Shane
The CPC in Australia...
Awa - CPCWiki

gerald

Quote from: KaosOverride on 00:10, 25 June 17
As far as I know, there are some different .CPRs of the same game because of:


-Dumping the cart at full addresing, so a 128kb romchip is read as 512kb with repeated blocks
-Carts from the Gx4000 demostrator, which are mostly cutdown versions, like some Pang dumps
-Correct 128kb dump extracting the romchip or manipulating a 512kb dump.


The rom mirrors can give problems if the game uses out of logic tricks to select rom pages. Same as partial IO decoding, using unofficial IO ports because you save some ASM ins...
To my knowledge, none of the released game make use of the rom mirroring. If any of them did, it would not work on C4CPC.
C4CPC always show as a 512k ROM.

Powered by SMFPacks Menu Editor Mod