UNIHIKERHow to select

PyCharm IDE Support on UNIHIKER

userHead Matha.Goram 2024-08-01 21:58:53 2307 Views4 Replies

Hello!

 

Posting for the first time. I am a total newbie at this.

 

While I await delivery of one UNIHIKER, I am preparing for ramp up exercises. Glad that Jupyter is supported out-of-the box. This little things are very thoughtful design considerations to speed up our productivity.

 

Has anyone used PyCharm IDE successfully to perform development work? Any tips, please. Thanks.

 

Regards.

2024-08-13 23:14:33

@Matha.Goram … I use Professional since years (it's worth to buy it in case of Python) and don't know so much about the difference to free version. But I assume you're right.

userHeadPic Lupin
2024-08-02 20:35:16

I use PyCharm for development on UNIHIKER (mostly every time) and will try to guide you. Important: If you decide for same you need to ensure that UNIHIKER is connected via USB and connected before you start PyCharm! I will describe from scratch - after you have done the following steps, just open your PyCharm project.

 

Create a new Project

 

Press button “New Project” and in next window provide a Name, Location, select Interpreter type (Project venv) and select a Python version. Note: The local Python version can be much higher as Python version on UNIHIKER. If you are done, press button “Create”.

 

Setup Remote Python

 

Open “Settings” and select under category “Tools” → “SSH Configurations”. Now add a new configuration. Insert the ip address of UNIHIKER in field Host (10.1.2.3). Insert the Port: 22 and Username “root”. Now select Authentication type. If you use Password, insert “dfrobot”. If you have on UNIHIKER already added you public key in the file “authorized_keys”, you can choose for example “OpenSSH config and authentication agent”. Now press button “Test Connection”. If this was successful, more than the half of work is already done.

 

Switch back to Project: [xxxx] → Python Interpreter, inside settings. Now press “Add Interpreter” → “On SSH”. Select radio button “Existing” and select inside dropdown “SSH Server” your created SSH Configuration. Finish Step 2 and 3. With this finished you can ignore the local Python version! After some time, you should see the packages from UNIHIKER.

 

Setup Deployment

 

Under “Build, Execution, Deployment” → “Deployment” select new “SFTP”. Also select here your “SSH Configuration” and insert into “Root Path” the value “/”. Switch to tab “Mappings” and provide the respective value for “Local path” and “Deployment Path”. The value for Deployment Path is “/root” but this can spoil the folder on UNIHIKER. I recommend value like “/root/projects” (in that case you should have create the directory on UNIHIKER already). If you'r done press button “OK”.

 

Confusion about Python/MicroPython

 

Don't use MicroPython plugin or something like this! UNIHIKER is not like ESP32 or RP2040. There is no MicroPython installed on UNIHIKER and it would not make sense, because it's a Debian Linux. The translation of Python code to the MCU is mostly done by “pinpong library”. You can verify that with “pip” you can install mostly all libraries. The Package manager for MicroPython is “mip” but this will not help! In case of interfaces provided by the UNIHIKER MCU (eq. SPI, I2C, GPIO, Buzzer, etc.) you cannot use Python libraries! Here you need to import pinpong (already explained).

 

 

userHeadPic Lupin
Matha.Goram wrote:

Hello @Lupin,

 

Thanks for your detailed instructions. It seems that running Remote SSH requires PyCharm Professional. Is my understanding correct?

 

Regards.

 

 

2024-08-12 23:22:03
1 Replies
2024-08-02 00:04:34

You can download PyCharm from the JetBrains website. Choose the Community edition if you need a free option, or the Professional edition if you have a license. You will have to configure PyCharm for MicroPython Development by installing MicroPython Plugin.

 

 

userHeadPic lia.ifat