Closed lmiori92 closed 1 year ago
Update: the GUI part is also ready. Now, I need to do more in-depth testing.
EDIT: unfortunately the write operations are unreliable (not sure if that would happen on serial port only, too). Reads appear to be fine, but i suspect they may also fail. A) Reads are always carried out successfully, MemCardRex does not hang nor PS1CardLink hangs. Subsequential reads seems always to match the content. At least regarding save data, some unused space may be different across cards copied on the PS1, I guess due to different free space handling and old data, too. B) Writes are finiky. Sometimes the operation completes successfully (memcardrex + ps1cardlink not hanging, transitioning to Waiting for PC) other times the write progress bar completes on memcardrex but PS1CardLink hangs indefinitely on "Writing to memory card" while some other times the progress bar freezes completely, including PS1CardLink exactly as mentioned above. C) I cannot get a full 0x00 card after formatting, not sure why, but most probably this is related to the write issues.
Next steps: pepper the code with printfs on the PC side to check if some failure goes unnoticed; check why flusing the incoming data before write was necessary on the serial port and see if it is acting up for the network transport.
EDIT 2: awww silly me .... I failed to adjust the busy-wait loop for reception of data! For quick-test, enlarging the delay from 5ms to 100ms made reading and writing reliable. I could format a card and after reading it back it was properly zeroed. Now, I need to think a proper time-out / busy-wait logic also for the network where latency is considerably higher / random than the serial I/O. Most probably the logic is changed to "when no more bytes are received, then start the timeout timer".
The feature can be reviewed, I'm happy with it. It works. Someone needs to kindly do some regression testing for the normal serial communication.
I like the idea of WiFi bridge but unfortunately I cannot get it to work. I seem to be using the same module as you. I flashed esp-link and that part is working properly, I can connect to ESP and configure it using web browser.
But, the second I connect RX line on the module it's all over. It becomes unresponsive and even pinging becomes an issue. PS1CardLink sits idle while that is happening so I know it's not spamming the module... Have you had these kind of issues?
OK, I managed to figure it out. Onboard USB-TTL chip interferes with the pin, it's keeping it LOW all the time. I need to power the module with USB and disable internal pull-up and then it works. On your image I see that you are powering it with 3.3V from the PlayStation, so maybe there are some differences between the modules. I have another ESP-01 without the USB-TTL chip so I can just use that.
None the less it works, albeit a little slow, I'll take a look at it. Also speed needs to be set to 38400bps manually to work with PS1CardLink but that one is on me, I should have just gone with 115200bps by default like a sane person. I'll switch to 115200bps in new releases.
I've regression tested serial communication and it's working properly as it should.
I've changed some stuff so there are some merge conflicts but I'll try to fix those manually because I would like to add this feature. Thank you for developing this.
@ShendoXT nice, thank you for all your tests, I really appreciate that the idea is going to be merged. Happy to see my contribution is interesting.
I'm working on adding the communication with a bridged serial port over TCP/IP. I have successfully attached a ESP8266 board to the TX and RX lines on my PSOne. The ESP8266 runs the software "esp-link" which, among many other features that are of no interested for that purpose, creates a serial bridge i.e. a client application can open a raw socket to the dedicated port and read/write from the serial port.
The first tests are promising (it works :-) ) and the development branch is currently there, I still need to implement the GUI part to setup the address and the port.
https://github.com/lmiori92/memcardrex/tree/support-for-esp-link-wifi-serial-bridge
Note: the implementation is really basic, a better design would be to split the communication-specific code in several classes with a common interface. But I don't think it's really necessary, let's see.
Here's a pic of the WiFi PSOne :-)