-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to access %s #4
Comments
Correction, I'm using a 1.3" OLED with an SH1106 controller. I discovered this issue was because your code is written for Python 2. I ran it through 2to3 to convert to Python 3 but now when I run: python3 oledterm.py --i2c-port 0 --display sh1106 I get: Traceback (most recent call last): Some junk appears on the screen for a few seconds while the above prints, then it goes blank. Any thoughts? Perhaps this is an orphan project...... |
bump |
Hi peterbmckinley, I have the same Problem like you and i think, i slowly get it work. I did a convert with 2to3, so the code can run thrue python3, because luma.oled ONLY runs now in Python3. like you said it runs in trouble in line 100 term.putch(char) with the reason unexpected type, needed string. |
So i tried to get it work, what would be nicer than a REAL RETRO PI with OLED Terminal ;-)
So now the Oled (SSH1106) shows up with number per line. |
😳
…On Sat, 22 Aug 2020, 18:39 Krizzel87, ***@***.***> wrote:
So i tried to get it work, what would be nicer than a REAL RETRO PI with
OLED Terminal ;-)
for char in data: if '\r' in chr(char): term.carriage_return() elif
chr(10) in chr(char): #term.newline() # no scroll, no flush
term.carriage_return() x = 0 term._cy += term._ch elif '\b' in chr(char):
term.backspace() x =- 1 elif '\t' in chr(char): term.tab() else:
term.putch(chr(char))
So now the Oled (SSH1106) shows up with number per line.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFONLDIUXX25QLX75FPJ5HTSB77GZANCNFSM4PADFK5Q>
.
|
oh and you need to edit the go.sh insert this
hope you have installed python libs etc |
the only thing I need to learn is how |
Good luck! I can't help you with that, but good work 🤞😊 |
here is the full new python 3 code
|
but you can test it! |
is luma.oled installed to your python3 and running succesfull? Now I have Holiday and want to make a cool pi Server. Learnd python with google^^ and i can read and understand. It was horrible the problem seems to be the change from python2 to python3 wit how Chars and Strings were used. |
To run on boot, add to /etc/rc.local:
|
See OP: "Luma.oled is installed and working, and can display all the luma.examples" Yes the change from Python 2 to Python 3 is a huge problem for the inexperienced |
but i thing the auto boot will only work when you are the ONLY user on your pi and only log in once. https://www.dexterindustries.com/howto/run-a-program-on-your-raspberry-pi-at-startup/ |
I test it with pi 4 latest raspian OS and SH1106. |
Fantastic! I'll be home soon and will test it. Im using Orange Pi Zero but
hopefully it will work too.
…On Sat, 22 Aug 2020, 19:53 Krizzel87, ***@***.***> wrote:
I test it with pi 4 latest raspian OS and SH1106.
now it Work. Only issue --rotate 1 und 3 does not work correctly.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFONLDKDZGQWAPHS2RSVG6LSCAH2TANCNFSM4PADFK5Q>
.
|
I fail the hole evening, because i Booted to Desktop and not to CLI, it can be changed in
but then you need to resize in line 17, to resize Display
Until Screen looks like this at programm start
Not like this
Have Fun |
It works! Thank you :) |
Hi Krizzel87, I've re-opened this issue as I can't get it to autorun at boot. Adding python3 oledterm/oledterm.py --i2c-port 0 --display sh1106 to /etc/rc.local fails with a Compatibility error. I tried adding python3 oledterm/oledterm.py --i2c-port 0 --display sh1106 to ~/.profile, which I've used to automatically run other scripts (my Orange Pi Zero is set to automatically login the root account) but the output seems to get stuck in a loop, it's like the oled is trying to display 2 or more processes. Have you had any success getting oledterm to run automatically at boot? |
Okay. I created a new go.sh with
Edit /etc/rc.local
|
I'm getting this during boot: [ 33.402269] rc.local[1148]: python3: can't open file 'oledterm/oledterm.py': [Errno 2] No such file or directory The path I added in /etc/rc.local works fine: python3 oledterm/oledterm.py --i2c-port 0 --display sh1106 Any idea why it fails to execute during runtime? |
You need to Start the script with sudo
And you need to use absolute Adress of the oledterm.py |
exactly the same [ 33.826075] rc.local[1166]: python3: can't open file 'oledterm/oledterm.py': [Errno 2] No such file or directory Here is the complete /etc/rc.local file: #!/bin/sh -e rc.localThis script is executed at the end of each multiuser runlevel.Make sure that the script will "exit 0" on success or any othervalue on error.In order to enable or disable this script just change the executionbits.By default this script does nothing.sudo python3 oledterm/oledterm.py --i2c-port 0 --display sh1106 & exit 0
It is the absolute path. It works when I paste it into a Command Prompt |
no idea why the formatting is all messed up, sorry about that. #new problems |
Hmm... okay. I is that Problem i had last evening, to auto Boot the script via rc.local I solved it with sudo raspi-config Boot options Boot to Cli with auto login |
You did not used the absolute Adresse Absolute Adresse always begin with /xxx/yyy/fite.date When you use |
so editing /etc/rc.local only works with users, not root? |
The script rc.local is done durring local loginprogress. Sudo is to make you root that means Root is path / So if you write
It Will not executed, but if you put this code to rc.local
It will run |
It Work now for you? No sh1106 ist not the Same SSD1306 both are oled 1.3 inch. Try to play with arduino to see Differenz. Ssd1306 is better |
If your TFT run you of screen all the time correct the in oled.py rows= 9 Try 8 or 7 |
Let me know when you get it working after login. Good luck! |
It Work I dont have issues |
Can you upload a photo of your oled screen AFTER you log in. As requested
before. Mine is fine up to the login screen, but after I log in its unusable.
…On Mon, 24 Aug 2020, 00:47 Krizzel87, ***@***.***> wrote:
It Work
I dont have issues
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFONLDKXVXBIO54PTFD4K3TSCGTAJANCNFSM4PADFK5Q>
.
|
No. see videos. By the way 0.91" and 0.96" oled displays are always SSD1306 controller. |
So if you upload a video of your display AFTER YOU LOG IN, and its ok, then I know the problem is with Orange Pi Zero and it can't be fixed. So can you please upload a new video, AFTER log in. |
You are lucky! Good work Krizzel87 👍😁 Any idea why its unstable for me? I can't use it. Would you consider getting an Orange Pi Zero and fixing it for me? As you know its not possible to make a commercial product from a Raspberry Pi, because the Compute module is too expensive. |
May be the Resolution is wrong. Oledterm.py try to play with COLS = 24 and ROWS = 7 . I would try
Or try Other fonts in def main or size.
|
I know the resolution for both the 0.96" SSD1306 and the 1.3" SSH1106 is
128x64, but surely yours is the same?
I haven't changed the defaults.
But I'll try it later today. What settings did you use to make it stable?
…On Mon, 24 Aug 2020, 11:39 Krizzel87, ***@***.***> wrote:
May be the Resolution is wrong.
Oledterm.py try to play with COLS = 24 and ROWS = 7 . I would try
VIRTUAL_TERMINAL_DEVICE = "/dev/vcsa"
ROWS = 9
COLS = 31
Or try Other fonts in def main
fontname = "tiny.ttf"
size = 6
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFONLDI6HFB2HGMKCC2FJNLSCI7PHANCNFSM4PADFK5Q>
.
|
I prefer tiny.ttf, but the are more cool fonts.i use size 6 to 12. But always have to fit COLS and ROWS . On your screen it you truely have to much |
Given that yours works and you are using the same resolution display
(128x64), please post your CURRENT values for SIZE, ROWS & COLUMNS
I will match your values and re-test. Hopefully that will fix my problem.
…On Mon, 24 Aug 2020, 11:52 Krizzel87, ***@***.***> wrote:
I prefer tiny.ttf, but the are more cool fonts.i use size 6 to 12. But
always have to fit COLS and ROWS
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFONLDOWYSBQIB5AAEJVQETSCJA5NANCNFSM4PADFK5Q>
.
|
Maybe your Problem is that the fontscrip doesnt fit to terminal size and thats why it is shifted? Try to typ And see if it will Happen again. I valve rows 9 cols 31 |
I haven't changed it from the default "Tiny ttf".
If you could post your own settings for size, rows and columns for a
working system using the same screen it would be very helpful.
I haven't changed my settings from the default. (size 6, 9 rows and 31
columns I think from memory)
Thanks in advance. Peter
…On Mon, 24 Aug 2020, 12:55 Krizzel87, ***@***.***> wrote:
Maybe your Problem is that the fontscrip doesnt fit to terminal size and
thats why it is shifted? Try to typ clear after logged in
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFONLDLROQQL7SUWBXYEYLTSCJIKBANCNFSM4PADFK5Q>
.
|
I Gott it to Work like yours. |
You can fix it, I have much confidence in you 😁
Did you use the code from the later commit, that claims to fix
this problem? I sent a screenshot
…On Mon, 24 Aug 2020, 13:08 Krizzel87, ***@***.***> wrote:
I Gott it to Work like yours.
It shiftig away all the time
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFONLDJHDQR5XHVZEKPV2DTSCJJ5RANCNFSM4PADFK5Q>
.
|
It happend during change virtual Terminal2 with cntl Alt F2 . When i go black to virtual terminal 1 it will work. Dont know how to change Resolution of Terminals. But how ever the issue is there. |
Log in and typ in Bash It will change the size off terminal play around to find best valvues |
Good work. I'll try it later today when I get home.
Peter
…On Mon, 24 Aug 2020, 14:02 Krizzel87, ***@***.***> wrote:
Log in and typ in Bash stty rows 7 and stty col 24
It will change the size off terminal play around to find best valvues
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFONLDI73H2YU4MHOBRP5DTSCJQG7ANCNFSM4PADFK5Q>
.
|
Ok I opened T2 with ctrl-alt-F2, but when I went back to T1 (ctrl-alt-F1) the problem is the exactly the same as shown in my videos. 🙄 I know Richard Hull is looking at doing a complete clean-room rebuild of oledterm, with a view to adding to his luma.examples repo. If you can't fix it maybe he can, or maybe you can fix it together. Check issue #120 on oled.examples Github page. rm-hull/luma.examples#120 (comment) Hope this helps |
Its good that you're seeing the same issue, so we know it isn't platform specific |
Cool never read it before! i used original oledterm. And than run it my self thrue 2to3 and begann to debug it. The code works with no Problems. |
Might be worth enabling some virtual RAM by creating additional swap file? In my example 384MB. dd if=/dev/zero of=/root/myswapfile bs=1M count=384 I had to do that just to install luma.oled, or the process gets killed from lack of memory. |
Hi Im keen to use this with my Orange Pi Zero setup. Luma.oled is installed and working, and can display all the luma.examples. I'm using an SSD1306 controller OLED display connected via the i2c bus. When I run the following command from the oledterm directory:
sudo python3 oledterm.py --display ssd1306 --interface i2c --rotate 2
it blows up as follows:
File "oledterm.py", line 55
print "Unable to access %s, try running as root?" % (VIRTUAL_TERMINAL_DEVICE,)
Any clues what might be wrong?
Peter
The text was updated successfully, but these errors were encountered: