Go to advanced search

by California
Sat Feb 15, 2020 7:28 pm
Forum: Python
Topic: Start the GUI app after RPi boot
Replies: 5
Views: 283

Re: Start the GUI app after RPi boot

I don't have user autostart in /home/pi/.config/.... modifying autostart in option 3 gave positive result.
It works now as expected.

Thanks for help
Regards, Vlado
by California
Sat Feb 15, 2020 6:02 pm
Forum: Python
Topic: Start the GUI app after RPi boot
Replies: 5
Views: 283

Re: Start the GUI app after RPi boot

I know that, but what I don't know which autostart file is the correct one?
1... /etc/xdg/openbox/autostart
2... /etc/xdg/lxsession/LXDE/autostart
3... /etc/xdg/lxsession/LXDE-pi/autostart
by California
Sat Feb 15, 2020 9:31 am
Forum: Python
Topic: Start the GUI app after RPi boot
Replies: 5
Views: 283

Start the GUI app after RPi boot

Hello, I have the GUI app made in QT4 (python3), which I would like to run automatically after Pi3B boot. On Pi2B I did it with (python2): nano /home/pi/.config/lxsession/LXDE-pi/autostart @lxterminal -e python /home/pi/Project/main.py This doesnt't work on Pi3, what would you suggest? Regards, Vlado
by California
Sat Feb 01, 2020 11:09 am
Forum: Python
Topic: RPI-4 serial question
Replies: 1
Views: 588

Re: RPI-4 serial question

For those who will face into the same issue. More diging ower the web gave result. 1. dtoverlay=uart5 into config.txt 2. def init_serial(): COMNUM = 2 global ser ser = serial.Serial() ser.port = "/dev/ttyS0" ser.baudrate = 19200 ser.parity=serial.PARITY_NONE ser.stopbits=serial.STOPBITS_ONE ser.byte...
by California
Fri Jan 31, 2020 4:51 pm
Forum: Python
Topic: RPI-4 serial question
Replies: 1
Views: 588

RPI-4 serial question

Many sites with this topic were observed today, but for me not clear answer. On RPi-3B code below works ok, but on RPi-4 ... Are there any instructions available to setup serial port step by step? And very important: is it possible to use GPIO14 & GPIO15. (pin 8 and 10), I would like to keep hardwar...
by California
Sun Jan 26, 2020 8:00 am
Forum: Python
Topic: Segmentation error (py3)
Replies: 3
Views: 268

Re: Segmentation error (py3)

Same issue as before, last test with code below ... hope to get some results ... I have no idea why data is written twice (two rows). Is it possible in python to get the usage of RAM? def poraba_2_xls(a, b, c, d, e, f, g, h, i): global poraba_2_xls_flag if poraba_2_xls_flag == True: ime = datetime.n...
by California
Fri Jan 24, 2020 11:45 am
Forum: Python
Topic: Segmentation error (py3)
Replies: 3
Views: 268

Re: Segmentation error (py3)

Thanks for the respond. After some testing time window for writteing into file was mooved into "free" time space. Before serial communication was happend during writteing into file. I am not sure this was the reason for crash, but we will see ...
by California
Thu Jan 23, 2020 2:56 pm
Forum: Python
Topic: Segmentation error (py3)
Replies: 3
Views: 268

Segmentation error (py3)

So, this message is shown when application is in normal operation for a few hours, after that, application is switched off automatically. Aplication description: app controls few RS485 slaves to collect some measurement data like temperature, flow of the watter ... Data is shown on graph and also wr...
by California
Sat Jan 11, 2020 8:15 am
Forum: Python
Topic: Oscilloscope
Replies: 10
Views: 975

Re: Oscilloscope

It is now working. I used "img.blank()" to clear the previous scan line. Seems simple - but not easy finding the command. Also seems obvious now. I was also using gui rather than img before understanding what I was doing! Out of interest the speed that this runs at is about 1500 readings per second...
by California
Wed Dec 11, 2019 7:56 pm
Forum: Python
Topic: Threading problems
Replies: 18
Views: 1029

Re: Threading problems

Few more words ...
Running script all day long gives no errors, no warnings. Obviously this is right aproach to the programming of my application.
So once again, many thanks for helping and leading into right direction.

With best regards, Vlado
by California
Wed Dec 11, 2019 8:21 am
Forum: Python
Topic: Threading problems
Replies: 18
Views: 1029

Re: Threading problems

You are right, yesterday this exmple (with digital output for watchdog) was tested for hours and freezing of GUI was noticed after 3 hours, while digital output was stil in operation.
Thanks for your help, learned a lot ...

Regards, Vlado
by California
Tue Dec 10, 2019 9:25 am
Forum: Python
Topic: Threading problems
Replies: 18
Views: 1029

Re: Threading problems

Now I am the one to be confused ... I did install python 3.7 idle and code posted above run in it without errors or warnings, running code in Thonny's editor stil give the same warnings as before. Any explanation about it? However, small example of threading was made by myself, which is not dependen...
by California
Sat Dec 07, 2019 5:43 pm
Forum: Python
Topic: Threading problems
Replies: 18
Views: 1029

Re: Threading problems

Somehow acidntly part code with "t1.join(), t2.join(), t3.join()" was removed and threading started to work, so I put your idea from yesterday on delay for some time.
by California
Sat Dec 07, 2019 2:40 pm
Forum: Python
Topic: Threading problems
Replies: 18
Views: 1029

Re: Threading problems

GUI modul. Becouse of the maximum characters number limit, some lines of the code are deleted, but all methods used in main program are there. gui_47.py: # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'Master_47.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WAR...
by California
Sat Dec 07, 2019 2:32 pm
Forum: Python
Topic: Threading problems
Replies: 18
Views: 1029

Re: Threading problems

Code so far, it needs harware to run it. In python 2.7 version it includes also graphs, writteing and reading into-from xls files and more. main.py: # -*- coding: utf-8 -*- import gui_47 import sys import os import datetime from slaves import * from dig_izhodi import * from PyQt4 import QtCore, QtGu...
by California
Sat Dec 07, 2019 1:42 pm
Forum: Python
Topic: Threading problems
Replies: 18
Views: 1029

Re: Threading problems

Thanks for your responds. This warning appears only with the last release of the Raspbian, no warnings with Jessie.
by California
Sat Dec 07, 2019 7:22 am
Forum: Python
Topic: Threading problems
Replies: 18
Views: 1029

Re: Threading problems

It works now, but I got warning message: "QPixmap: It is not safe to use pixmaps outside the GUI thread".
What does it mean? How to avoid it?
by California
Fri Dec 06, 2019 11:15 am
Forum: Python
Topic: Threading problems
Replies: 18
Views: 1029

Re: Threading problems

Thanks. Very helpful piece of the code. Let me implement your idea into my code.

Regards
by California
Thu Dec 05, 2019 9:29 pm
Forum: Python
Topic: Threading problems
Replies: 18
Views: 1029

Re: Threading problems

Thanks both of you for the respond. Function "digitalna_ura()" provides time variables which are used later in function "aktivnosti_po_uri()" to triger some communication activities (for test only time.sleep for 5 seconds). And yes, it is tigered with QTimer every second. Third function controll dig...
by California
Thu Dec 05, 2019 8:26 am
Forum: Python
Topic: Threading problems
Replies: 18
Views: 1029

Threading problems

Hello, I want to have three diferent threads working independet of each other but without succes so far. Below is a test code where first thread is digital clock which take care for providing time variables which are used in second thread which trigers some actions depending on time. In test we have...
by California
Sun Nov 10, 2019 12:56 pm
Forum: Python
Topic: Conversion
Replies: 17
Views: 755

Re: Conversion

Thanks to all of you, code works as expected.

With best regards,

Vlado
by California
Sun Nov 10, 2019 12:07 pm
Forum: Python
Topic: Conversion
Replies: 17
Views: 755

Re: Conversion

@billio:
so far so god, it looks ok - I have to do more tests

@rpiMike:
your result is also ok, but it is coded in normal float 32 (IEEE) standard, for me it is used Microchip float 32 standard
by California
Sun Nov 10, 2019 7:13 am
Forum: Python
Topic: Conversion
Replies: 17
Views: 755

Re: Conversion

First of all, I want to thank all of you for your help here. The purpose of this part of the code is converting temperature setpoint (float) into bytes on the Rpi3 which represents master in RS485 network. Floating point number 5.1 is just an example, could be used any other positive or negative num...
by California
Sat Nov 09, 2019 7:47 pm
Forum: Python
Topic: Conversion
Replies: 17
Views: 755

Re: Conversion

In python 2 result is: (129L, 35L, 51L, 51L)
In python 3 result is: (129, 35, 51, 51)

As you can see, diference is in the letter L. Maybe this is what error message say.
So, how to get the letter L into result?
by California
Sat Nov 09, 2019 6:43 pm
Forum: Python
Topic: Conversion
Replies: 17
Views: 755

Re: Conversion

@jahboater: your lines of the code works ok, but not with the rest of the code lines. The very same error as before: ... i %= 4294967296 TypeError: not all arguments converted during string formatting @rpiMike: described part of the code works ok, but yes, your solution looks much better than my... ...

Go to advanced search