Partager des fichiers avec votre CNC Mekanika

Comment créer un dossier partagé sur votre machine CNC

Nos machines CNC sont toutes équipées d'un Raspberry Pi 4B. Il est donc très facile de mettre en place un dossier partagé qui vous permet d'envoyer des fichiers et des codes G sur votre réseau local. Cet article explique comment y parvenir en quelques étapes.

Dossier partagé stocké sur votre machine CNC (Windows 10)

Étape 1 : configurer votre ordinateur

Tout d'abord, vous devez configurer votre ordinateur pour partager des fichiers sur votre réseau local. Naviguez jusqu'à la liste des réseaux WiFi, assurez-vous que votre ordinateur est connecté au bon réseau, puis cliquez sur Propriétés.

Cnc dossier partagé propriétés wifi

Vérifiez que le profil "Réseau Privé" (Private Network) est sélectionné.

Cnc dossier partagé configuration wifi

Ensuite, activez les options de découverte du réseau et de partage de fichiers et d'imprimantes en suivant ces étapes :

  1. Ouvrez le panneau de configuration (Control Panel)
  2. Sélectionnez Réseau et Internet > Centre Réseau et Partage > Paramètres de partage avancés  (Network and Internet > Network and Sharing Center > Advanced sharing settings).
  3. Sélectionnez l'option "Activer la découverte du réseau" (Turn on network discovery).
  4. Sélectionnez l'option "Activer le partage de fichiers et d'imprimantes" (Turn on file and printer sharing) sous la section "Privé" (Private).
  5. Enregistrez les modifications.

Cnc dossier partagé désactiver features windows

Enfin, ouvrez le Panneau de configuration (Control Panel), sélectionnez Programmes (Programs), puis cliquez sur Activer ou désactiver les fonctionnalités de Windows (Turn Windows features on or off).

Cnc Shared Folder Turn windows Features Off

Faites défiler vers le bas et vérifiez que la case Client SMB 1.0 est cochée.

Cnc dossier partagé Smb 1.0

Redémarrez votre ordinateur.

Étape 2 : connectez votre machine CNC au réseau

Allumez l'unité de commande de votre machine et attendez que le système démarre.

Minimisez la fenêtre PlanetCNC pour voir le bureau. Cliquez sur l'icône WiFi en bas à droite et activez le WiFi.

Cnc dossier partagé allumer wifi

Vous devriez voir une liste de tous les réseaux locaux disponibles. Cliquez sur le nom de votre réseau et tapez le mot de passe si nécessaire.

Vous pouvez également connecter directement votre unité de commande à votre routeur à l'aide d'un câble Ethernet et sauter la partie de configuration du WiFi.

Redémarrez le Raspberry Pi en cliquant sur l'icône Raspberry, Déconnexion, puis Redémarrage (Reboot).

Cnc dossier partagé relancer l'ordinateur

Étape 3 : commencer à partager des fichiers

De retour sur votre ordinateur, ouvrez l'explorateur de fichiers et naviguez jusqu'à Réseau (Network). Vous devriez voir un périphérique appelé RASPBERRYPI.

Cnc dossier partagé Raspberry Pi

Double-cliquez sur ce périphérique pour accéder au dossier partagé (Shared folder) de votre machine.

Si vous y êtes invité, vous pouvez saisir le nom d'utilisateur et le mot de passe par défaut du Raspberry Pi
- Nom d'utilisateur : pi
- Mot de passe : raspberry

Vous pouvez maintenant accéder au dossier partagé et y copier des fichiers. Ils apparaîtront automatiquement dans le même dossier sur votre machine.

Cnc dossier partagé chemin accès PC

Cnc dossier partagé Raspberry Pi Accès

Pour accéder à ce dossier depuis votre machine, il suffit de cliquer sur le raccourci en bas à gauche et de naviguer jusqu'à Shared.

Dossier partagé stocké sur votre machine CNC (Mac OS)Dossier partagé stocké sur votre machine CNC (Mac OS)

Assurez-vous que votre ordinateur est connecté à votre réseau local avant de commencer.

Allumez l'unité de commande de votre machine et attendez que le système démarre.

Minimisez la fenêtre PlanetCNC pour voir le bureau. Cliquez sur l'icône WiFi en bas à droite et activez le WiFi.

Cnc Shared Folder allumer Wifi MAC

Vous devriez voir une liste de tous les réseaux locaux disponibles. Cliquez sur le nom de votre réseau et tapez le mot de passe si nécessaire.

Vous pouvez également connecter directement votre unité de commande à votre routeur à l'aide d'un câble Ethernet et sauter la partie de configuration du WiFi.

Redémarrez le Raspberry Pi en cliquant sur l'icône Raspberry, Déconnexion, puis Redémarrage (Reboot).

Cnc Shared Folder Network Discovery Reboot

De retour sur votre ordinateur, ouvrez le Finder et naviguez jusqu'à Réseau (Network). Vous devriez voir un périphérique appelé RASPBERRYPI. Double-cliquez dessus.

Cnc Shared Folder Mac Finder

Si vous y êtes invité, vous pouvez saisir le nom d'utilisateur et le mot de passe par défaut du Raspberry Pi
- Nom d'utilisateur : pi
- Mot de passe : raspberry

Vous pouvez maintenant accéder au dossier partagé et y copier des fichiers. Ils apparaîtront automatiquement dans le même dossier sur votre machine.

Pour accéder à ce dossier depuis votre machine, il suffit de cliquer sur le raccourci en bas à gauche et de naviguer jusqu'à Shared.

Cnc Shared Folder Mac

Access a Folder Stocked on your Computer from your CNC

This is our recommended setting:
Configuring a shared folder so you can access your files when navigating on your CNC machine. This way, you can work on your projects on your PC, save the G-code files in this shared folder, then go to your machine and open those file directly without the need for a USB key.
 

1.A. Windows 11 PC Configuration

 
First we need to setup the shared folder on your Windows 11 PC.

1.1. Shared folder configuration

  • Right-click on the folder you want to share > Properties > Sharing > Advanced Sharing
  • Check "Share this folder" (you can put a sharing name if you want it to be different than the folder's name)
  • Click OK
  • Note the PC name (e.g., "MYPC") and the share name (e.g., "shared-folder")
    They are shown in the sharing window in "Network path". In my example the path is "\\QUENTINMEKANIKA\shared-folder" (PC name = QUENTINMEKANIKA and Share name = shared-folder)

share windows 11 folder

1.2. Windows user with password

To access the folder from an external machine, you'll be requested the password of a user of the PC.

  • If you use a PIN and not a password to connect to your your Windows account, it can't be use for an external machine: create a real password in Settings > Accounts > Sign-in options.
  • If you can't or don't want to, an easy alternative is to create another account on the computer that will only be used for sharing and choose its password (this prevents from sharing your main account password)
    Go to Settings > Accounts Other Users > Add an account and create a sharing account and keep note of the Username and Password you choose.

1.3. PC and CNC on the same network

Last thing to check on the PC: it has to be connected to the same internet network as the CNC machine (we will connect it in the next step). It can be by WiFi or by Ethernet cable, as long as it is the same network.

1.B. Mac OS Configuration

1.1. Shared folder configuration

  • On your Mac, choose Apple menu > System Settings, click General in the sidebar, then click Sharing
    While you are here, take note of the computer's name for the next steps.

  • Below Content & Media, click the Info button next to File Sharing.

  • Turn on File Sharing.

  • Click Options, then turn on “Share files and folders using SMB.”

  • Add the folder you want to share with the +.
    Take note of the name of the file too for the next steps.

 

2. CNC Machine Configuration (Raspberry Pi's script to access the folder)

IMPORTANT: Using the Virtual Keyboard

In several steps you will be required to type some text on the machine, but it doesn't have a keyboard.
Connecting an external keyboard to the machine can bring some complications and disconnect the machine's Keypad, so here's a solution: the virtual keyboard.

  • Go to Raspberry Logo > Accessories > Virtual Keyboard
  • A keyboard will appear on the screen, you can use it as a regular keyboard using the touchscreen.
  • Special characters are accessible through shift and/or the special character button on the left

2.1. Connecting the CNC to internet

If it is not the case yet, we need to give internet access to the Raspberry Pi (the computer) of the machine.
 
The easiest way is to connect an Ethernet cable at the back of the control unit. Otherwise you can connect it by WiFi this way:
  • Turn on your control unit and wait for the system to start.
  • Minimize the PlanetCNC window to see the desktop.
  • Click on the bottom-right WiFi icon (2 bars with red crosses) and turn on the WiFi.
  • You should see a list of all the local networks available.
  • Click on the name of your network and type the password using the virtual keyboard if needed.
    Remember: it has to be the same network as the PC.

Mekanika Cnc Shared Folder Turn on Wifi on tour raspberry pi

2.2. The Configuration Script for the CNC Machine

  • Download this Windows Share To Exctract ZIP file and Extract it on a USB key (Right Click > Extract to...)
  • Plug the USB key into the machine and Copy the "windows-share" folder to the Raspberry Pi Desktop (you can drag it from the USB drive). It should NOT be a .zip file, just a regular folder with 4 files inside.
  • Open the Readme-EN file and Copy the command line indicated entirely (either by long-clicking on the touch screen > Copy, or by plugging a USB mouse into the machine Right-Click > Copy)
cd ~/Desktop/windows-share && bash script-EN.sh
  • Open a Terminal (Black icon in the taskbar at the bottom)
  • Paste the copied command into the Terminal and press Enter to run the configuration script.
  • Follow the script instructions in the terminal.
  • Confirmations with "Y/N" require typing the letter Y for Yes and N for No, then pressing Enter.
  • Use the Virtual Keyboard to fill in the requested information that you have from previous steps:
    PC name,
    Share Folder name on the PC
    PC user Name
    PC user Password (invisible characters)
    And a name for the shared folder on the CNC machine (or press Enter for default "pc-share")

Complete the instructions until it says you are done, then restart the machine:
Raspberry logo > Shutdown > Reboot.

That's it !
 

3. How it works

  • The shared folder will be accessible on the CNC at "/home/pi/pc-share" and visible on the explorer just like a USB key (the folder name might differ if you chose a different one).
  • Automatic mount/unmount is done at machine startup if the PC is also On and connected (it may take a little while to appear as it waits for stable internet connection).
  • A monitoring service checks the connection status every 30 seconds; this way it should follow the PC state (if it disconnects, the folder is unmounted on the machine too - and reconnects when the PC is back on).
  • Additionally, a "Windows Share Control" icon appears on the desktop to control it manually if needed.

If needed, here are the terminal commands to control it (last resort)

bash
winshare mount      # Mount
winshare unmount    # Unmount
winshare status     # View status
winshare restart    # Restart
 

4. Common Issues in the configuration script

  • "Permission denied"
    > Check your Windows username and password
  • "Could not resolve"
    > Try using the PC's IP address (e.g., 192.168.1.1) instead of its name
  • File explorer freezes when clicking the folder
    > The PC was disconnected and the Watchdog did not yet check the connection. it will automatically unmount within 60 seconds.
    > Or use: `winshare unmount` in Terminal

5. Uninstall

bash
sudo systemctl stop mount-winshare.service mount-winshare-watchdog.service
sudo systemctl disable mount-winshare.service mount-winshare-watchdog.service
sudo rm /etc/systemd/system/mount-winshare*
sudo rm /usr/local/bin/mount-winshare* /usr/local/bin/winshare
rm ~/.smbcredentials
sudo systemctl daemon-reload
You can also stop the sharing of the folder in Windows.

À propos de Mekanika

Mekanika est une entreprise belge basée à Bruxelles dont l'ambition est de rendre la production locale plus accessible grâce à une approche 100% open-source.

Nous concevons et produisons des machines de haute qualité pour le fraisage CNC et la sérigraphie, qui ont été reconnues pour leur fiabilité et leur facilité d'utilisation. Nos outils sont livrés en kits et entièrement documentés, permettant facilement de les adapter à des besoins spécifiques.

Visitez notre boutique pour en savoir plus, ou consultez notre ressources en ligne et tutoriels pour continuer à apprendre.

Articles connexes

Resuming an Interrupted Milling Progam on PlanetCNC
Reprendre un usinage interrompu sur PlanetCNC

Planet CNC offre la possibilité de démarrer un G-Code à partir d'une ligne spécifique plutôt que depuis le début. Cette fonctionnalité peut s'avérer utile pour reprendre un travail interrompu pour diverses raisons, telles qu'une panne de programme/ordinateur, une coupure de courant ou un arrêt d'urgence.Planet CNC offre la possibilité de démarrer un G-Code à partir d'une ligne spécifique plutôt que depuis le début. Cette fonctionnalité peut s'avérer utile pour reprendre un travail interrompu pour diverses raisons, telles qu'une panne de programme/ordinateur, une coupure de courant ou un arrêt d'urgence.Planet CNC offre la possibilité de démarrer un G-Code à partir d'une ligne spécifique plutôt que depuis le début. Cette fonctionnalité peut s'avérer utile pour reprendre un travail interrompu pour diverses raisons, telles qu'une panne de programme/ordinateur, une coupure de courant ou un arrêt d'urgence.

Quentin Liard

Quentin Liard

Customer Support

 <img src="image.jpg" alt="">
Comprendre et optimiser ta table à dépression

Découvre comment maximiser les performances de ta table à vide en apprenant des conseils pratiques sur les stratégies de coupe, l'entretien du spoilerboard et bien d'autres choses encore.

Maxime Gravet

Maxime Gravet

Product Engineering