WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Install my python program into PiCore (Raspberry Pi)  (Read 5981 times)

Offline Aladin

  • Newbie
  • *
  • Posts: 40
Install my python program into PiCore (Raspberry Pi)
« on: May 18, 2020, 06:59:44 PM »
I apologize first, im new in PiCore, i used Raspbian but now i want to use PiCore into my Raspberry pi 3+, im try to use picore 10.0 beta
now i finished my python program and i want to install it and run it 
my problem is how to install or copie all my python script (folder) in the SD card and visualize it in PiCore (i mean in Raspbian i use git clone)
then i want to make the program run for the first boot of Raspberry

i don't found any tuto for this

any suggestion?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11590
Re: Install my python program into PiCore (Raspberry Pi)
« Reply #1 on: May 18, 2020, 09:05:37 PM »
Hi Aladin
... my problem is how to install or copie all my python script (folder) in the SD card and visualize it in PiCore (i mean in Raspbian i use git clone) ... 
If you want  git, you can install it:
Code: [Select]
tce-load -iw git
Quote
then i want to make the program run for the first boot of Raspberry ...
Only the very first time it was ever booted? Create a script called  RunOnce.sh  in /opt containing:
Code: [Select]
#!/bin/sh

# Test if  /opt/FirstBoot  exists. Exit the script if it does.
[ -e "/opt/FirstBoot" ] && exit

# /opt/FirstBoot  didn't exist, so create it.
touch /opt/FirstBoot

Place the command to run your program here

Make the script executable:
Code: [Select]
chmod 775 /opt/RunOnce.sh
If you are running X, you can create a file (name doesn't matter) in  ~/.X.d  containing the following line:
Code: [Select]
/opt/RunOnce.shThis will launch the script once X is running.

If you are not running X, you can add the  /opt/RunOnce.sh  line to  ~/.profile.

You may also want to take an hour to read this fine book:
http://tinycorelinux.net/corebook.pdf
It will teach you some concepts that are unique to Tinycore Linux.

Offline Aladin

  • Newbie
  • *
  • Posts: 40
Re: Install my python program into PiCore (Raspberry Pi)
« Reply #2 on: May 18, 2020, 09:50:02 PM »
Can i copie my code directly into sd card without git ?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11590
Re: Install my python program into PiCore (Raspberry Pi)
« Reply #3 on: May 18, 2020, 10:00:45 PM »
Hi Aladin
Create a directory for your code in the second partition of your SD card and copy your code there. Then when you have your
Pi up and running, you can decide where you want to store your code and move it there.

Offline Aladin

  • Newbie
  • *
  • Posts: 40
Re: Install my python program into PiCore (Raspberry Pi)
« Reply #4 on: May 18, 2020, 10:02:57 PM »
Sorry sir, but how can I know the second partition
And how can I move and store


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11590
Re: Install my python program into PiCore (Raspberry Pi)
« Reply #5 on: May 18, 2020, 10:17:42 PM »
Hi Aladin
Have you installed piCore to a SD card?
Did you read:
http://tinycorelinux.net/10.x/armv7/test_relases/RPi/README
and:
http://tinycorelinux.net/10.x/armv7/test_relases/RPi/IMPORTANT

Sorry sir, but how can I know the second partition ...
Under piCore it shows up as  mmcblk0p2.


Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: Install my python program into PiCore (Raspberry Pi)
« Reply #6 on: May 19, 2020, 02:51:01 AM »
What is the OS of the computer that you use to create the SD card?

Offline Aladin

  • Newbie
  • *
  • Posts: 40
Re: Install my python program into PiCore (Raspberry Pi)
« Reply #7 on: May 19, 2020, 05:10:25 AM »
Im using PiCore 10.0 beta
I use etcher to install it in SD card

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: Install my python program into PiCore (Raspberry Pi)
« Reply #8 on: May 19, 2020, 06:15:22 AM »
I didn't know etcher worked on PiCore?


Offline Aladin

  • Newbie
  • *
  • Posts: 40
Re: Install my python program into PiCore (Raspberry Pi)
« Reply #10 on: May 19, 2020, 03:59:36 PM »
What do you mean sir with what is the OS computer that use to create the sd card

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: Install my python program into PiCore (Raspberry Pi)
« Reply #11 on: May 19, 2020, 07:33:26 PM »
OS = operating system ie. Raspbian, piCore, Windows, Andriod, iOS, some other Linux.

What is the computer you are creating your SD card on?

Where are your python programs located?

Is your git repository on a local computer/server or is it GitLab, GitHub etc.

Offline Aladin

  • Newbie
  • *
  • Posts: 40
Re: Install my python program into PiCore (Raspberry Pi)
« Reply #12 on: May 19, 2020, 07:37:25 PM »
Im using Windows in my laptop
And i try to use Picore in my Rpi 3+
Python programs are located in my laptop and i save it in github repository

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: Install my python program into PiCore (Raspberry Pi)
« Reply #13 on: May 20, 2020, 01:16:45 AM »
By default Windows (10?) only sees the first partition of the SD card. Depending on the size of your python files you can copy them to the first (boot) partition then transfer the SD card to the RPi. By default, piCore does have the first partition mounted after it finishes booting, so you will need to mount it to move the files to their final location.

If ssh is running on your RPi, you can use a program like WinSCP (or FileZilla?) to transfer files back on forth between your laptop and RPi - that's what I do. I use WinSCP's synchronize to keep files up-to-date.

By default, piCore only has microPython installed with very few libraries. You will probably have to install full version of python to run your scripts.

Offline Aladin

  • Newbie
  • *
  • Posts: 40
Re: Install my python program into PiCore (Raspberry Pi)
« Reply #14 on: May 20, 2020, 05:54:02 AM »
I will try using ubuntu in my laptop after that i will use pyinstaller but then i don't know how to install (copier ) the file in SD card and after that use it on the RPI