PDA

View Full Version : Adding I2C OLED TO Picoreplayer.



nimaazx
2019-01-21, 07:11
Hello guys. I recently managed to launch the RPi Zero w with pcm5102 or USB dac running PCP OS. everything worked perfect. As the latest work I want to add i2c oled to picoreplayer OS.
One of the most important is the IP address display or some python linux functions on the oled. I saw lms info is showed for clients in some projects. but it is different.
I know the code and python programming , but I faced a few major challenges.

https://gist.github.com/rfong/2c36b87ff22077f8dd9afd513c519a80

here is some good information for me.Like exactly what i want. but it is for Raspbian OS.
First, I do not have access to the kernel access in PicorePlayer, and many Linux commands are not detected on this operating system.
for example The "raspi-config" command can not be executed and found. or enabling I2C in raspbian is easy but in PCP OS not mentioned and I could not find!
need to install GPIO...

I have seen some projects like slimmer but they are different or information of implementation is not written or different of mine or oled module is different.
I actually want to use i2c popular oled like ssd1306 or similar and using python for show some information about OS like IP address or connected to wifi or not.
i may want to add other info but still my goal is that I said.

is it possible ? what you thought about this?

Greg Erskine
2019-01-21, 13:54
hi nimaazx,

It can be done but there are going to be some challenges.

We adhere to the TinyCore/piCore mantra, so piCorePlayer is roughly 40M, Raspbian approx. 4G, there are one or two things missing!! :)

Learn the limitation of the Busybox version of the Linux commands. In normal use its not major issue.

We decided not to include Python because its relatively big, but microPython is there but not many libraries.

No bash, just ash.

Beware that extensions in the piCore repository may not be compatible with piCorePlayer. We are usually many kernels ahead.

Paul maintains heaps of extensions for piCorePlayer, but generally only those we use.

Looks like i2c overlay is loaded by default (in config.txt): dtparam=i2c_arm=on,spi=on,i2s=on

regards
Greg

nimaazx
2019-01-22, 01:24
hi nimaazx,

It can be done but there are going to be some challenges.

We adhere to the TinyCore/piCore mantra, so piCorePlayer is roughly 40M, Raspbian approx. 4G, there are one or two things missing!! :)

Learn the limitation of the Busybox version of the Linux commands. In normal use its not major issue.

We decided not to include Python because its relatively big, but microPython is there but not many libraries.

No bash, just ash.

Beware that extensions in the piCore repository may not be compatible with piCorePlayer. We are usually many kernels ahead.

Paul maintains heaps of extensions for piCorePlayer, but generally only those we use.

Looks like i2c overlay is loaded by default (in config.txt): dtparam=i2c_arm=on,spi=on,i2s=on

regards
Greg

OK , thank you Greg. is it possible to install normal python in picoreplayer or add other linux command ? it seems to be limited and many command are not found. for example i think we can't use "git" command.
and harder than that, some python libraries like RPi.GPIO are not built or supported for micropython.

it seems to me there is only one way and it is installing normal python.

what do you think about that limitation for python libs ? what can we do?
have you ever implemented the project like this?

about i2c enabled thanks to developers. you made it a little easier for me ;)

Greg Erskine
2019-01-22, 13:04
hi nimaazx,

piCorePlayer is small in fact it is tiny. :D We only add "exactly" what we need to make piCorePlayer work. No bash, no nano, no python, no git, no compiling tools, no Xwindows, no million other things!!!

But you can pretty much do anything you want, its just a matter of how much effort you are willing to put in. :D

TinyCore info: http://tinycorelinux.net/book.html

In piCorePlayer to download an extension use [Main Page] in [Advanced] mode > [Extensions].

There are 2 repositories, TinyCore/piCore and piCorePlayer containing different extensions. But be warned, there are complications between arm6/arm7, piCore9/piCore10, and the different kernel levels of piCore vs piCorePlayer.

If you want an easy path for following projects on the internet, just use Raspbian.

Slimmer is a similar project to what you are doing https://github.com/terba/slimmer/wiki/Building-a-player

regards
Greg

nimaazx
2019-01-23, 05:13
hi nimaazx,

piCorePlayer is small in fact it is tiny. :D We only add "exactly" what we need to make piCorePlayer work. No bash, no nano, no python, no git, no compiling tools, no Xwindows, no million other things!!!

But you can pretty much do anything you want, its just a matter of how much effort you are willing to put in. :D

TinyCore info: http://tinycorelinux.net/book.html

In piCorePlayer to download an extension use [Main Page] in [Advanced] mode > [Extensions].

There are 2 repositories, TinyCore/piCore and piCorePlayer containing different extensions. But be warned, there are complications between arm6/arm7, piCore9/piCore10, and the different kernel levels of piCore vs piCorePlayer.

If you want an easy path for following projects on the internet, just use Raspbian.

Slimmer is a similar project to what you are doing https://github.com/terba/slimmer/wiki/Building-a-player

regards
Greg

thank you.
yesterday I found extension option in menu and installed python 3.4 dev but i did not tested anything.
after that I tested GPIO by just linux scripting and can on/off led module. for testing connecting to wifi it is enough for me. when it is connect , led is going to be on.
for connecting i2c oled and showing ssid name , maybe it can be done but it depends some libs can be installed and compiled with our python version.

Actually I have read your Glossary in main page.
But Don't understand the difference between Pcp and picoreplayer.
I use latest standard version of Pcp.
it is newer i guess.

about slimmer yes it is a little similar. I use other oled module and wiring and driver is different i think.
many C++ files and the files should be compiled in slimmer and even I don't know what they are. for me is confusing :D

I found python3.4 dev in extension , if it is same as normal python I can run it. :D

Greg Erskine
2019-01-23, 12:58
https://www.picoreplayer.org/main_glossary.shtml