Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: JonHylands on November 17, 2020, 06:01:35 PM

Title: pyserial in python3.6
Post by: JonHylands on November 17, 2020, 06:01:35 PM
Hi everyone,

First post here, I'm trying to set up piCore on a rpi zero w, and I need to access a usb-based serial port. I see there is support for pyserial in python 2, but all my robot code (which I've already written) runs in python 3. I'm running piCore 9.0.3.

What is the easiest way to get pyserial available in python 3.6?

Thanks,
Jon
Title: Re: pyserial in python3.6
Post by: Juanito on November 18, 2020, 01:03:11 AM
You can compile pyserial for python3.6 in piCore-9.x with:
Code: [Select]
$ tce-load -i compiletc python3.6-dev
$ wget https://github.com/pyserial/pyserial/archive/v3.4.tar.gz
$ tar xf v3.4.tar.gz
$ cd pyserial-3.4
$ python3.6 setup.py build
$ sudo python3.6 setup.py install --root=/tmp/pkg

..and then make an extension out of the files under /tmp/pkg
Title: Re: pyserial in python3.6
Post by: JonHylands on November 18, 2020, 10:23:27 AM
..and then make an extension out of the files under /tmp/pkg

I managed to build & install, but this part has me scratching my head a bit. The instructions I've found seem overly complex. Are there clear instructions anywhere?

Thanks,
Jon
Title: Re: pyserial in python3.6
Post by: Juanito on November 18, 2020, 11:03:04 AM
Code: [Select]
...
$ cd /tmp
$ tce-load -i squashfs-tools
$ sudo mksquashfs pkg/ py3.6serial.tcz