Elegoo Mars & Saturn
WiFi Usb flash drive (WIP) - Printable Version

+- Elegoo Mars & Saturn (https://www.elegoomars.com/forum)
+-- Forum: Elegoo Mars 3D Printer (https://www.elegoomars.com/forum/forumdisplay.php?fid=1)
+--- Forum: Printer Mods / Add-Ons (https://www.elegoomars.com/forum/forumdisplay.php?fid=4)
+--- Thread: WiFi Usb flash drive (WIP) (/showthread.php?tid=399)



WiFi Usb flash drive (WIP) - demer - 02-29-2020

The final scope is to remotely sent files to my Elegoo Mars 3D printer with the help of raspberry pi zero w board. (WIP)

Similar to The MagPi magazine's article the owner of photon printer (Will Koone) make a ready to use image file that can be found here
(https://drive.google.com/file/d/1sh5zXyoxc1IQGEPHbKztDUQXdAzlZ43N)

I use Windows 7, and Putty to communicate with Pi. You need also one program to write the image to the microSD (like Etcher from Balena) and your favorite text editor (like Notepad++). It handy to have also an Ip scanner (like ipscan24) to find the IP of your pi.

original info pages:
https://magpi.raspberrypi.org/articles/pi-zero-w-smart-usb-flash-drive
https://www.facebook.com/groups/AnycubicPhoton/permalink/1611674765643826/)

>Make WiFi USB flash driveĀ 

- Write the img to microSD (minimum SD size 4GB suggested size is 16GB)
- After finish, load again the SD and add two text files 'ssh' (without extension!!!) and 'wpa_supplicant.conf' (.conf !!!) inside the second one enter your wifi data (SSID-password). You can google the filename for sample (also I have add sample files).
- Remove the SD from computer and put it to the pi zero and power up it from power port.
- After pi boots (you can check the green light became steady on), run the ipscan24 to find the ip of the pi. If you can't find check again the data in wpa_supplicant.conf (when pi boots it delete the two extra files)
- run Putty and enter the ip of pi to make ssh connection. Default name will be pi and the password is raspberry. You don't need to change that if you have secure WiFi network at home.
-If all went ok so far, at windows Network you can see a new computer with name 'RASPBERRYPI' and with shared folder named 'usb'. This is the folder that we will sent the files to the printer.
- Because the initial folder space is the minimum (512MB) in order to fit the image to 4GB SD, you can run this command at the terminal (with putty)

sudo rm /photon.bin
sudo dd bs=1M if=/dev/zero of=/photon.bin count=8192
(NOTE: this will take some minutes to finish, don't power down the pi)
sudo mkdosfs /photon.bin -F 32 -I
sudo reboot now

(2048=2G, 4096=4G, 8192=8G and so on) Make sure you leave room for the OS.

Please note that after any reboot or halt the ssh connection with the putty is lost and you must start over.


>Connection with the Elegoo Mars:
Although in my laptop the pi zero working ok when connecting it with the 2nd usb port (NOT the power port) in my 3D printer there is problem with power. It cycles power on/off before pi zero loads properly. I have the newer board (w/o Lan port) and in info screen it says ChiTu L5.5 Series, Version v4.3.1
My temporary solution was 1st to power the pi zero with external power bank using the power port. After pi boots, I have connect the usb data cable to Elegoo Mars but with cutted (!!!) the red cable so do not pass power from my battery, back to my printer's board. Then I can normally see my files. 2nd solution: I also make a custom Y cable. One side with male USB and two female USB in parallel connection. Then FIRST power up the pi zero from the power port. AFTER boot ends (normally after couple seconds) THEN I connect the other USB cable to the data port of Pi Zero. After that I can see the files of shared folder. The drawback in this solution is that you have to disconnect the data cable after power off the printer. I need work with that....

>power on/off button:
adding a momentary switch to pins 5-6. It is safer to power down properly the pi zero, because you may have problems with the SD or worse with the board it self.

thru ssh (putty) run the command
curl https://pie.8bitjunkie.net/shutdown/setup-shutdown.sh | bash

after finished you must to edit the rc.local file
sudo nano /etc/rc.local
And right above 'exit 0' (last line) you must add the command:
sudo python /home/pi/scripts/shutdown.py &

Exit editor (Ctrl+X and choose Yes and press Enter, to save without change the filename)
sudo reboot

Original info at pages:
https://pie.8bitjunkie.net/retropie-shutdown-and-startup-switch-the-easy-way
https://www.dexterindustries.com/howto/run-a-program-on-your-raspberry-pi-at-startup/

>adding indicator led:
add a led between pins 6-8 with a resistor of about 300 Ohms for security. Pin 6 is our common negative pin so we use total 3 pins

connect the SD to computer and edit the file config.txt adding at the end the line
enable_uart=1

Original info at:
https://howchoo.com/g/ytzjyzy4m2e/build-a-simple-raspberry-pi-led-power-status-indicator

This solution it cost to me about 16 euros for the pi board with the case. The rest are from salvage stuff.


RE: WiFi Usb flash drive (WIP) - alizobil - 05-28-2020

hello, I have done what you have said, the PI ZERO is now working fine as a USB disk on my computer, on my TV SetupBox and same on my 3D printer.
BUT I can't do it using wifi...
I see the IP address from my PI ZERO on my internet box settings and a wifi is established. When I ping the IP adress, no respond. Same with Putty software... it says there is no Route...
When I plug it back to my computer, I can't change anything fas I can't edit the raspi-config. I have tried to connect it with WinSCP, same... not able to reach my PI ZERO IP adress...
Anyone has en idea ?
Actualy the only thing I can do is to copy my print file to my PI ZERO connected to windows and then plug it to my 3D printer and then print... well, that's how a regular USB is working... Purpose is to transfert file using wifi...


RE: WiFi Usb flash drive (WIP) - martinronz - 06-12-2020

Hey there,

did it with an self soldered usb Y-Cable, wifi & Samba is working but Mars Pro didn't recognize the USB,

at my Laptop everything is working fine.

Do you have an Idea?


thanks Smile


RE: WiFi Usb flash drive (WIP) - Martian - 06-28-2020

I am in the same situation as martinronz.

I ran through the setup demer listed here:
https://magpi.raspberrypi.org/articles/pi-zero-w-smart-usb-flash-drive

I had to make two modifications to make it work:
-Per Steve_W's comment on that article, "the line that says 'ExecStart=/usr/local/share/usb_share.py' should read 'ExecStart=/usr/local/share/usbshare.py' to work properly"
-Additionally, I could not get it to work without changing 'modprobe g_mass_storage file=/piusb.bin stall=0 ro=1' to 'modprobe g_multi file=/piusb.bin stall=0 removable=1' in the python script you download (See here for more details on that: https://raspberrypi.stackexchange.com/questions/63914/unable-to-configure-a-raspberry-pi-zero-as-a-usb-mass-storage-device-using-g-mas)

It now seems to work perfectly when connected to a variety of windows machines, but simply won't show up when connected to the Mars.
-I've tried a variety of combination of powering it externally, solely off the printer, etc. It seems most effective to use a data cable in the USB port with the red/voltage line removed, and power it separately via the PWR port.
-I've confirmed that it shows up as a FAT32 partition when connected to a Windows machine.

I have a brand new Mars, so it likely has the new board in it.
The software version reads: V4.3.2_LCDF /1440x2560 /F2.13

If anyone has had success getting past that point, please let us know.
It's a bummer to be so close, but not be able to get it to work.



Edit: Using the image linked in this video worked for me:
https://www.youtube.com/watch?v=gXpz9ovCS1w&t=310s

I'm not sure in what manner it differs from the rasbpi.org guide, but it functions as expected.
I expanded the size of the bin per the instructions in the video description (to 4GB).
If others are stuck here, consider trying this!


RE: WiFi Usb flash drive (WIP) - Van Valen - 11-08-2020

Has anyone gotten this to work on the new Mars 2 Pro? I've gone thru about a dozen variations but will not work. I can see the shared usb from my computers but not the printer itself.


RE: WiFi Usb flash drive (WIP) - Van Valen - 11-20-2020

[Image: pi78oaKdT.png]


RE: WiFi Usb flash drive (WIP) - satgod - 12-11-2020

has anyone got this to work 100%

I see where people get it to work on there pc but
have you tried to copy to it wirelessly and see if the files show up on the Drive letter create by the usb connection

I can copy files to it via usb or via wireless but neither side can see the files that I copied from their opposite without rebooting the unit
anyone else test this


RE: WiFi Usb flash drive (WIP) - Van Valen - 01-09-2021

Sadly I gave up and just bought a bunch of USB drives.