Best practice for developing python scripts for the RevPi?
Best practice for developing python scripts for the RevPi?
Hello,
how are you developing python scripts that are supposed to be running on the RevPi and that are using hardware features such as opening the process image? I can't test the script locally on my laptop as there is no process image...but copying it to the RevPi, run it and then go back to the IDE on the laptop for fixing bugs is tedious.
I've already looked at creating a samba share on the RevPi, but I'm unable to get it to work. I think it has something to do with our enterprise domain network and the RevPi not being part of it. I followed various tutorials and still didn't manage to mount the samba share on my windows laptop. Laptop is connected to the domain network via wifi and to the RevPi via ethernet (direct connection, no router).
SSHFS seems to be another option, but I didn't find a working implementation for Win10. WinSshFS Foreveryone claims to have Win10 support, but didn't work for me.
Has anyone managed to run the script on a remote kernel, e.g. using spyder? This sounds promising, but I havn't managed to get it to work yet: https://github.com/ipython/ipython/wiki ... el-via-ssh
how are you developing python scripts that are supposed to be running on the RevPi and that are using hardware features such as opening the process image? I can't test the script locally on my laptop as there is no process image...but copying it to the RevPi, run it and then go back to the IDE on the laptop for fixing bugs is tedious.
I've already looked at creating a samba share on the RevPi, but I'm unable to get it to work. I think it has something to do with our enterprise domain network and the RevPi not being part of it. I followed various tutorials and still didn't manage to mount the samba share on my windows laptop. Laptop is connected to the domain network via wifi and to the RevPi via ethernet (direct connection, no router).
SSHFS seems to be another option, but I didn't find a working implementation for Win10. WinSshFS Foreveryone claims to have Win10 support, but didn't work for me.
Has anyone managed to run the script on a remote kernel, e.g. using spyder? This sounds promising, but I havn't managed to get it to work yet: https://github.com/ipython/ipython/wiki ... el-via-ssh
Schönen Gruß,
matt.s
matt.s
Re: Best practice for developing python scripts for the RevPi?
Hi,
I've personally always used the x-windows desktop with the python shell when writing python scripts for a RevPi. Mostly this is due to the complex IO which would be difficult to simulate. When I do not have local access with HDMI Monitor and USB keyboard/mouse I do use realVNC which is part of our distribution. You simply need to configure your device to start realVNC and autoboot into GUI and then you can easily access your desktop with any PC running the realVNC client software. Installing a WebCam (which I've done once when I programmed our "Dobot" exhibit) gives you the feedback of your actuators whenever you need it. If you're not working in your company's LAN but over the WAN, then you must enable the "cloud connection" of your realVNC server for which you do need an account ( 3 devices are for free for test purpose). With a realVNC account you can easily work from all over the world without the need to manipulate anything on your firewall's parameters. The RevPi does open the tunnel to the Camebridge server over normal internet http(s) access and whenever a client is asking for connection it overtakes this tunnel establishing a point to point connection. If you want to secure this connectivity you can restrict the ability for clients to connect to your device by forcing a 2-way authentication or even by limiting it to certain devices.
It's easy, it's fun, it's secure...
I've personally always used the x-windows desktop with the python shell when writing python scripts for a RevPi. Mostly this is due to the complex IO which would be difficult to simulate. When I do not have local access with HDMI Monitor and USB keyboard/mouse I do use realVNC which is part of our distribution. You simply need to configure your device to start realVNC and autoboot into GUI and then you can easily access your desktop with any PC running the realVNC client software. Installing a WebCam (which I've done once when I programmed our "Dobot" exhibit) gives you the feedback of your actuators whenever you need it. If you're not working in your company's LAN but over the WAN, then you must enable the "cloud connection" of your realVNC server for which you do need an account ( 3 devices are for free for test purpose). With a realVNC account you can easily work from all over the world without the need to manipulate anything on your firewall's parameters. The RevPi does open the tunnel to the Camebridge server over normal internet http(s) access and whenever a client is asking for connection it overtakes this tunnel establishing a point to point connection. If you want to secure this connectivity you can restrict the ability for clients to connect to your device by forcing a 2-way authentication or even by limiting it to certain devices.
It's easy, it's fun, it's secure...
Unser RevPi Motto: Don't just claim it - make it!
Re: Best practice for developing python scripts for the RevPi?
I have already played around with the VNC and this is the way I'm currently working. But it would be nice to use an IDE like spyder and it seems that it's not recommended to install this directly on the RevPi because it's rather heavy.
Schönen Gruß,
matt.s
matt.s
Re: Best practice for developing python scripts for the RevPi?
Another thought on VNC: Does the preinstalled VNC-Server allow commercial use when I'm only using it locally to connect a VNC Viewer on the same LAN? The free RealVNC VNC Viewer license allows both private and commercial use, correct? So far I have only used it for testing purposes, but if I continue using it I'm not sure if I need to buy a professional package or not.
Schönen Gruß,
matt.s
matt.s
Re: Best practice for developing python scripts for the RevPi?
RealVNC gave us the information that using it locally in a LAN is free of charge with a RevPi.
If you want to be absolutely sure please contact RealVNC.
If you want to be absolutely sure please contact RealVNC.
Re: Best practice for developing python scripts for the RevPi?
Because of the domain stuff: i am using an usb ethernet adaptor on my laptop to directly connect the RevPi to it.
Software development was sometimes done on the laptop + copying the data to the Pi (via FileZilla), and sometime directly on the Pi (via SSH).
Software development was sometimes done on the laptop + copying the data to the Pi (via FileZilla), and sometime directly on the Pi (via SSH).
Re: Best practice for developing python scripts for the RevPi?
That's also the way I'm working at the moment. But it would be easier, especially for bigger projects, if I could mount the RevPi as a samba share on my Win10 laptop and run the IDE there. Unfortunately, when I try to do this I'm always getting "Error: 0x80070035. Network path not found" after trying to mount the RevPi as network drive. I'll open up another thread for this topic.Timo wrote: Because of the domain stuff: i am using an usb ethernet adaptor on my laptop to directly connect the RevPi to it.
Software development was sometimes done on the laptop + copying the data to the Pi (via FileZilla), and sometime directly on the Pi (via SSH).
Schönen Gruß,
matt.s
matt.s
Re: Best practice for developing python scripts for the RevPi?
Any specific reason for not using realVNC to share your desktop and thus reaching the IDE?
Unser RevPi Motto: Don't just claim it - make it!
Re: Best practice for developing python scripts for the RevPi?
The IDE would have to run on the RevPi and I've been reading reports from Raspi 3 users that running Spyder or PyCharm on the Raspi 3 is not really pleasent as they are rather heavy. Still, I'm currently trying out this option. At the moment I'm playing around with Spyder3 but it seems to be missing a package (rope).
Schönen Gruß,
matt.s
matt.s