Arduino Forum

Products => Arduino Yún => Topic started by: JLS1 on Mar 24, 2014, 02:11 pm

Title: How to import new modules to Python ?
Post by: JLS1 on Mar 24, 2014, 02:11 pm
Hi all

Is possible import new modules to linino python ? (like PySynth , Numpy, etc ...)

Thanks info

Kamil
Title: Re: How to import new modules to Python ?
Post by: esbjerg on Mar 24, 2014, 03:05 pm
I think if you try

http://forum.arduino.cc/index.php?topic=193155.msg1427318

It might be a start for you!
Title: Re: How to import new modules to Python ?
Post by: JLS1 on Mar 24, 2014, 11:50 pm
Many thanks working great !

One question - is possible install modules to SD card ?

Kamil
Title: Re: How to import new modules to Python ?
Post by: sonnyyu on Mar 25, 2014, 12:49 am
Rootfs on External Storage (extroot)

http://wiki.openwrt.org/doc/howto/extroot (http://wiki.openwrt.org/doc/howto/extroot)

Code: [Select]
#df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                15800240     85112  14905864   1% /
/dev/root                 7168      7168         0 100% /rom
tmpfs                    30568       312     30256   1% /tmp
tmpfs                      512         0       512   0% /dev
/dev/sda1             15800240     85112  14905864   1% /


Use 1% of rootfs, after I use  83 Mb.
Title: Re: How to import new modules to Python ?
Post by: JLS1 on Mar 25, 2014, 10:37 pm
Thanks but this is very difficult for me.

Exist simplest step by step guide how to make SD extroot ?

Sorry i´m beginner with linux.

Many thanks help

Kamil
Title: Re: How to import new modules to Python ?
Post by: sonnyyu on Mar 26, 2014, 01:55 am
Code: [Select]
df

Code: [Select]
fdisk /dev/sda
reboot


Code: [Select]
umount -f  /mnt/sda1
mke2fs -t ext4 /dev/sda1
mkdir -p /mnt/sda1
mount  /dev/sda1 /mnt/sda1
mkdir -p /tmp/cproot
mount --bind / /tmp/cproot
tar -C /tmp/cproot -cvf - . | tar -C /mnt/sda1 -xf -
umount /tmp/cproot
nano /etc/config/fstab


Code: [Select]
...
config mount
        option target        /
        option device        /dev/sda1
        option fstype        ext4
        option options       rw,sync
        option enabled       1
        option enabled_fsck  0


Code: [Select]
reboot
df


Title: Re: How to import new modules to Python ?
Post by: JLS1 on Mar 26, 2014, 10:21 pm
4GB rootfs :-D

Many many thanks this working fine !!!  :-)

One simple question - is possible make small partition fat32 ?
I´m use 4GB SD card - my idea 3GB ext for rootfs and second 1GB fat32 (for my winxp read)

Thanks help

Kamil

Title: Re: How to import new modules to Python ?
Post by: sonnyyu on Mar 26, 2014, 11:01 pm
Sure:

Code: [Select]
fdisk /dev/sda

make 2 partition:

/dev/sda1  3G
/dev/sda2  1G

Code: [Select]
mkdosfs -F 32 /dev/sda2
mke2fs -t ext4 /dev/sda1


http://forum.arduino.cc/index.php?topic=222069.msg1614584#msg1614584 (http://forum.arduino.cc/index.php?topic=222069.msg1614584#msg1614584)




Title: Re: How to import new modules to Python ?
Post by: JLS1 on Mar 27, 2014, 09:50 am
Test it and working but both me partition is only ext

1. fdisk and delete existing fat32 partition
2. make new primary aprox. 2G
3. make second primary 2G
4. write and quit fdisk

5. reboot

6. unmount sda1 and sda2 (test without this step and same result)
7. mkdosfs -F 32 /dev/sda2
8. mke2fs -t ext4 /dev/sda1

9. reboot

10. yes two partition but both linux ext - not fat32 !

please help thanks
Title: Re: How to import new modules to Python ?
Post by: sonnyyu on Mar 27, 2014, 03:57 pm
The output of

Code: [Select]
fdisk /dev/sda
Title: Re: How to import new modules to Python ?
Post by: sonnyyu on Mar 27, 2014, 06:15 pm
Sometime windows doesn't  like Fat 32 as second partition. Use fdisk set up Fat 32 as first one.

Code: [Select]
fdisk -l

Code: [Select]
  Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048    16779263     8388608    c  W95 FAT32 (LBA)
/dev/sda2        16779264    32372735     7796736   83  Linux


Code: [Select]
mkdosfs -F 32 /dev/sda1
mke2fs -t ext4 /dev/sda2


Code: [Select]
umount -f  /mnt/sda2
mkdir -p /mnt/sda2
mount  /dev/sda2 /mnt/sda2
mkdir -p /tmp/cproot
mount --bind / /tmp/cproot
tar -C /tmp/cproot -cvf - . | tar -C /mnt/sda2 -xf -
umount /tmp/cproot
nano /etc/config/fstab


Code: [Select]
config mount
       option target        /
       option device        /dev/sda2
       option fstype        ext4
       option options       rw,sync
       option enabled       1
       option enabled_fsck  0
Title: Re: How to import new modules to Python ?
Post by: JLS1 on Mar 27, 2014, 07:14 pm
Heeeeeej working !!!!!!

Many many thanks your time :-D

Kamil
Title: Re: How to import new modules to Python ?
Post by: NewLine on May 25, 2014, 05:40 pm
I followed these steps (tnx) to get the OS on my /dev/sda1 partition , but I am confused about 1 thing.

Previously I used /mnt/sda1 to put all my arduino stuff that are used by the sketch. I see this is still available.
Does it mean both / and /mnt/sda1  are mounted on my SD card?

I have following mount output:

Code: [Select]
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,noatime)
sysfs on /sys type sysfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime,size=30560k)
tmpfs on /dev type tmpfs (rw,noatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,noatime,mode=600)
/dev/sda1 on / type ext4 (rw,sync,relatime,user_xattr,barrier=1,data=ordered)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
/dev/sda2 on /mnt/sda2 type ext4 (rw,sync,relatime,user_xattr,barrier=1,data=ordered)
none on /proc/bus/usb type usbfs (rw,relatime)


it doesnt even mention /mnt/sda1, but I can write files to it...
Title: Re: How to import new modules to Python ?
Post by: federicofissore on May 25, 2014, 06:22 pm
It looks like you have a folder /mnt/sda1 but this is not bound to any sd card. I suggest you move those files away and remove the folder.

Instead, you're using the sd card to extend the disk space of the yun (good!) as row "/dev/sda1 on / type ext4" says

The "data" part of the sd card is available on /mnt/sda2. If you followed the tutorial for extending the disk space, typing
Code: [Select]
ls -la /mnt should show that /mnt/sd is indeed pointing to /mnt/sda2
Title: Re: How to import new modules to Python ?
Post by: NewLine on May 25, 2014, 09:02 pm
I used this page as guidelines. I manually made 2 partitions (sda1 and sda2) and moved the OS to sda2. I didnt do anything with sda2.

These are the /mnt folders:

Code: [Select]
drwxr-xr-x    4 root     root          4096 May 25 09:44 .
drwxr-xr-x   18 root     root          4096 May 25 09:46 ..
lrwxrwxrwx    1 root     root             9 May 25 09:44 sd -> /mnt/sda1
drwxr-xr-x    2 root     root          4096 May 25 17:32 sda1
drwxr-xr-x    3 root     root          4096 May 25 09:22 sda2


sd is still pointing to sda1.

I still wonder where I am actually writing if I write to /mnt/sda1?
/mnt is a subdir of root /, so I guess /mnt/sda1 is also on the SD card?
Title: Re: How to import new modules to Python ?
Post by: federicofissore on May 26, 2014, 09:01 am
I guess so. Try to compare your manual way to the sketch way of the tutorial
Title: Re: How to import new modules to Python ?
Post by: sonnyyu on May 30, 2014, 01:29 am
Code: [Select]
drwxr-xr-x    4 root     root          4096 May 25 09:44 .
drwxr-xr-x   18 root     root          4096 May 25 09:46 ..
lrwxrwxrwx    1 root     root             9 May 25 09:44 sd -> /mnt/sda1
drwxr-xr-x    2 root     root          4096 May 25 17:32 sda1
drwxr-xr-x    3 root     root          4096 May 25 09:22 sda2


Code: [Select]
sd -> /mnt/sda1 is symbolic link, you could safely delete it and recreate it as way you like.

Code: [Select]
ln -s  /path-text/of-symbolic-link  /path/to/file-to-hold-that-text

Code: [Select]
rm /mnt/sd
ln -s /mnt/sd  /mnt/sda2