gotek on-board spi-flash as usb stick

Post Reply
tooty
Posts: 13
Joined: Fri Mar 16, 2018 3:18 pm

gotek on-board spi-flash as usb stick

Post by tooty »

hi, jeff,

is there possibility to use the on board spi-flash serving as usb stick? accordingly the original usb port will be connected to computer as external mass storage device. or even better, you can leave the option into the setting menu(of course we have to install the spi-flash to the empty space by ourselves).

by that, it's very convenient if we only hook up the machine and computer with a usb cable. we can edit the document stored in the flash at the computer side, and machine can draw out the document at machine side.

best regards

Jeff
Site Admin
Posts: 8091
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: gotek on-board spi-flash as usb stick

Post by Jeff »

tooty wrote:
Sat Dec 21, 2019 10:36 am
hi, jeff,

is there possibility to use the on board spi-flash serving as usb stick? accordingly the original usb port will be connected to computer as external mass storage device. or even better, you can leave the option into the setting menu(of course we have to install the spi-flash to the empty space by ourselves).

by that, it's very convenient if we only hook up the machine and computer with a usb cable. we can edit the document stored in the flash at the computer side, and machine can draw out the document at machine side.

best regards
All is possible, but is it really interesting ? I mean that this can take me important among of time to achieve this.

tooty
Posts: 13
Joined: Fri Mar 16, 2018 3:18 pm

Re: gotek on-board spi-flash as usb stick

Post by tooty »

actually i'm thinking of possibility of freeing the usb port to wifi adapter so that the computer in the office can transfer the document to the gotek via network...
Jeff wrote:
Sat Dec 21, 2019 11:03 am
tooty wrote:
Sat Dec 21, 2019 10:36 am
hi, jeff,

is there possibility to use the on board spi-flash serving as usb stick? …

by that, it's very convenient if we only hook up the machine and computer with a usb cable. we can edit the document stored in the flash at the computer side, and machine can draw out the document at machine side.
All is possible, but is it really interesting ? I mean that this can take me important among of time to achieve this.

Jeff
Site Admin
Posts: 8091
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: gotek on-board spi-flash as usb stick

Post by Jeff »

tooty wrote:
Sun Dec 22, 2019 12:10 pm
actually i'm thinking of possibility of freeing the usb port to wifi adapter so that the computer in the office can transfer the document to the gotek via network...
Then there is already something working : Use an RaspberryPi Zero-W to emulate an usb stick. And connect to the RPi to update the virtual stick content. Tried it some years ago and this is working fine ! :D

:arrow:
Jeff wrote:
Mon Jul 23, 2018 4:05 pm
This is interesting because this is exactly what i tried some weeks ago, this setup works perfectly with the HxC firmware for gotek.

Attached is the proof-of-concept i made for the tests.
Basically all files added by FTP is automatically added to the the virtual usb stick.
hxc_stick_emu.zip
(1.01 KiB) Downloaded 222 times
I used my custom Linux setup/build to have a faster boot on the Raspberry Pi :

https://github.com/jfdelnero/LinuxFromScratch
https://github.com/jfdelnero/LinuxFromS ... o_w/config

I plan to add the HxC Software/library into the Raspberry Pi to convert on the fly all the currently non-supported images + the direct FAT images generation from a network drive.
This is something i already tried some years ago :

https://www.youtube.com/watch?v=R9wGYqrM-68
https://www.youtube.com/watch?v=4CC7_IDqVnQ
https://www.youtube.com/watch?v=wJEekEhZtD8
hxc_stick_emu.zip
(1.01 KiB) Downloaded 222 times

tooty
Posts: 13
Joined: Fri Mar 16, 2018 3:18 pm

Re: gotek on-board spi-flash as usb stick

Post by tooty »

wow! i'll try it some time. many thanks.
Jeff wrote:
Sun Dec 22, 2019 4:13 pm
tooty wrote:
Sun Dec 22, 2019 12:10 pm
actually i'm thinking of possibility of freeing the usb port to wifi adapter so that the computer in the office can transfer the document to the gotek via network...
Then there is already something working : Use an RaspberryPi Zero-W to emulate an usb stick. And connect to the RPi to update the virtual stick content. Tried it some years ago and this is working fine ! :D

Jeff
Site Admin
Posts: 8091
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: gotek on-board spi-flash as usb stick

Post by Jeff »

tooty wrote:
Fri Dec 27, 2019 2:10 am
wow! i'll try it some time. many thanks.
BTW i think i will prepare a dd image of my RPI Zero W sdcard. It is currently working as an access point but the network setting can be changed as you want .

agent29
Posts: 67
Joined: Sun May 08, 2016 10:42 am

Re: gotek on-board spi-flash as usb stick

Post by agent29 »

I have a few old unused RPi model b's with 256mb.

I would be quite interested in an image, Im not particularly clever with software and only have a rudimentary understanding of command line but would find it a great help to network the emulator.

Would it be possible and or feasible to network multiple HXC devices through a hub of some kind?

regards

Jeff
Site Admin
Posts: 8091
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: gotek on-board spi-flash as usb stick

Post by Jeff »

agent29 wrote:
Fri Jan 17, 2020 11:33 am
I have a few old unused RPi model b's with 256mb.

I would be quite interested in an image, Im not particularly clever with software and only have a rudimentary understanding of command line but would find it a great help to network the emulator.
Thanks to remind me this. I will prepare a DD image.
agent29 wrote:
Fri Jan 17, 2020 11:33 am
Would it be possible and or feasible to network multiple HXC devices through a hub of some kind?
The most standard way is to setup check RPi Zero as wifi client and make them to connect automatically to an access point. Then each "HxC Gotek" will be reachable through the network.

Jeff
Site Admin
Posts: 8091
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: gotek on-board spi-flash as usb stick

Post by Jeff »

This is finally done :

https://hxc2001.com/download/floppy_dri ... ulator.zip

Use the usb device port to connect the Raspberry Pi Zero W to the Gotek.

You can access the virtual stick through Wifi. The Raspberry is by default an access point. (HxC2001_RPIZeroW SSID)

The following services are enabled in the image :

IP : 192.168.100.1

Samba/Windows Share -> login : data, password : data
ftp -> login : data, password : data
ssh -> login : data, password : data / login : root, password : root
http -> just a test page for the moment.

I will document and make further developments on this new powerful Gotek companion.
:)

agent29
Posts: 67
Joined: Sun May 08, 2016 10:42 am

Re: gotek on-board spi-flash as usb stick

Post by agent29 »

Hi Jeff,

Have you progressed at all with the rpi project. I do not own a zero and attempted to use the supplied image with a rpi1 model b with external wifi devices to no avail, rpi2 and rpi3 fail to boot past the splash screen?

kind regards.

JeanFred64
Posts: 5
Joined: Sat Mar 07, 2020 3:25 pm

Re: gotek on-board spi-flash as usb stick

Post by JeanFred64 »

hi Jeff,

I tried the "hxc stick emu" on the gotek :wink:
it works fine thanks for this build of your linux from scratch
https://github.com/jfdelnero/LinuxFromS ... ree/master

The gotek is connected to a PC (AMD K6-2 300Mhz)
As expected, I can send files with samba access via wifi on the GOTEK.
On the PC (AMD K6-2 300Mhz), I can modify the contents of the floppy disk images (format the disk, copy or edit a file, etc.).
When I change floppy disks on the GOTEK, I see that the information is saved on the local floppy disk image file.
But on the SAMBA share (virtual_stick/data), the floppy disk image file remains in its initial state, and changes are not saved.
When the rpi is switched off, the modified data is lost.

What would be the best solution ?

1) SSH command
Similar to what we do on Pauline in simulation mode, by running an ssh command
Here, we could make a copy of the files

"virtual_stick.img"

Code: Select all

cp -R /root/virtual_stick.img /home/data/virtual_stick/old_data/virtual_stick.img
or the "/media/virtual_stick/" folder

Code: Select all

cp -R /media/virtual_stick/* /home/data/virtual_stick/old_data
And recover them via samba before rebooting or deleting the file "delete_to_update.txt" :)

2) Modify "/etc/samba/smb.conf"
Is adding the command create mask = 0777
[data]
path = /home/data
how = data home (login: data / pass: data)
write access = yes
valid users = data
creation mask = 0777
forced creation mode = 0777
directory mask = 0777
force directory mode = 0777
3) Modify "stick_emu.sh" by adding -ro=0
modprobe g_mass_storage file=/root/virtual_stick.img stall=0 ro=0 removable=y iSerialNumber=1234567890
https://www.kernel.org/doc/Documentatio ... torage.txt


I don't know much about Linux, and to avoid quickly destroying the RPi's µSD card with too many unnecessary read and write accesses.

What do you think about best solution to implementing this feature ?

Post Reply