Open Git572 opened 1 year ago
Hi Ulrich,
thank you for your message.
Just a couple of questions:
Could you please send me this logfile? Just in case you don't see the "AppData" folder: It's a hidden folder, therefore you must enable hidden folders in the Explorer.
Best regards Philipp
Hi Philipp, thanks for your quick response. Yes, I use the exe-file. I saw today, that you launched a new version and tried it before starting the issue. The log is touched when starting CriticalForce.exe with or without sensor (timestamp gets updated) but stays empty anyway. debug.log
The MCP2221A gets recognised and listed as I plug it in.
I had the opportunity to try it on an old laptop. Where everything works fine. I'll test to start it in a new account tomorrow.
Best regards Ulrich
Hi Ulrich,
okay, good to hear that the hardware is working with an other laptop. This means that it's unlikely to be a hardware issue.
Are both laptops you've tried running Windows 11? To be honest, I've only tried it on Windows 10 so far.
I've build a Debug version of the application. This is exactly the same software as version 1.2.1, except that a terminal opens as soon as the app is started. Could you please check, if there are any error messages shown in the terminal? Critical Force Debug Version
Thanks a lot for your effort and sorry for the inconvenience.
Best regards Philipp
Send without seeing your answer first :-( I'l try the Debug version. Thanks so much for your effort.
Good Morning Philipp,
I didn't tell the complete hardware yet: Load cell --> NAU7882 --> MCP2221 --> USB On the old laptop where it is working there is Windows 10 professionel and USB 2.0
On the desktop computer where CriticalForce.exe does only start without sensor it's Windows 11 home. Tried USB 2.0 and 3.0. The new user didn't help either. Using "compatibility mode Windows 8" didn't make no difference.
Best regards Ulrich
Hi Philipp,
I'm doing now everything with your Debug version on Windows 11. Not depending if the sensor is plugged in the debug.log always gets touched but stays empty.
Starting with sensor attached: debug.log gets touched, terminal is opening, blinking cursor but nothing else Task-Manager shows two background processes of the CriticalForce_DEBUG.exe. One with 2.1 MB RAM usage and on with ~54 MB RAM usage. waited for five minutes After closing the terminal the bigger background process stays alive and I can't kill it within the task manager. Everything reproducible.
Starting without sensor attached: app starts immediately, process is listed as "App", and there is one background process. Both closing when closing the app.
Started out of a terminal with ".\CriticalForce_DEBUG.exe" the results are the same.
I compared it with the old laptop with windows 10. Here are, as you will know, a background process and one foreground process. Both of them terminating when closing the app.
Best regards Ulrich
Hi Ulrich,
that is very strange. I've got no idea, whats happening here. I've built another debug version, where I've manually added some print statements. Ideally, the terminal output should look like this:
Could you please tell me, up to which comment/number it is working for you?
Best regards Philipp
Hi Philipp, sorry, I'm not at home at the moment but I'll test it in a week.
Best regards Ulrich
Von: Philipp Bulling @.> An: OddgitHub/Critical-Force @.> Kopie: Git572 @.>; Author @.> Datum: 09.04.2023 11:50:24 Betreff: Re: [OddgitHub/Critical-Force] Program only starts when sensor is not attached (Issue #3)
Hi Ulrich,
that is very strange. I've got no idea, whats happening here. I've built another debug version[https://www.dropbox.com/s/v454o229i3jeqyr/CriticalForce_DEBUG2.exe?dl=1], where I've manually added some print statements. Ideally, the terminal output should look like this: [https://user-images.githubusercontent.com/120595692/230766063-a4c69b1e-de41-4290-aa86-838d3dd1ff2f.png][Terminal][https://user-images.githubusercontent.com/120595692/230766063-a4c69b1e-de41-4290-aa86-838d3dd1ff2f.png]
Could you please tell me, up to which comment/number it is working for you?
Best regards Philipp
— Reply to this email directly, view it on GitHub[https://github.com/OddgitHub/Critical-Force/issues/3#issuecomment-1501089463], or unsubscribe[https://github.com/notifications/unsubscribe-auth/ARFHCWEZK3UKRAHEBCVJL6LXAKA5XANCNFSM6AAAAAAWVODEFM]. You are receiving this because you authored the thread.[Verfolgungsbild][https://github.com/notifications/beacon/ARFHCWGG7JFGEEFUC6INZ63XAKA5XA5CNFSM6AAAAAAWVODEFOWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTSZPDHLO.gif]
Hi Philipp,
sorry, was getting home late yesterday. Just tested your new debug version 2.
As you can see, it stopped after "02 - Import board". I could see the device (MCP2221) in the device list, but it disappears for a split second, when I start the CritiicalForce_DEBUG2.exe right after the messages come visible in the terminal.
Best regards Ulrich
I think that the device disappears should be no problem, this also happens on my computer.
Unfortunately, I've got no idea, whats happening here. You said, the NAU7802 is connected to the MCP2221 via the Qwiic connector and the setup is working fine on an other computer?
Hi Philipp,
sorry, was getting home late yesterday. Just tested your new debug version 2.
As you can see, it stopped after "02 - Import board". I could see the device (MCP2221) in the device list, but it disappears for a split second, when I start the CritiicalForce_DEBUG2.exe right after the messages come visible in the terminal.
Best regards Ulrich
Hi Philipp,
the Sensor is this one then comes the "Adafruit NAU7802 24-Bit ADC Compatible with Arduino STEMMA QT Qwiic 4538" Connected via: SF14426 SparkFun 4pin 1mm pitch JST Qwiic Cable - 50mm QITA Angebots-Nr.: 353139031770 to the "Adafruit MCP2221A Breakout - General Purpose USB zu GPIO ADC I2C"
and yes, it works o.K. on my old laptop with windows 10, which is nearly used to capacity just running windows :-)
Do you think it would help anything to run the debug version from source per "python start.py"? The normal v1.2.1 didn't give any output on the terminal (but I think that's how it is written).
Best regards Ulrich
Yes, it could be helpful, if you would run the app directly as Python script. Are you familiar with Python?
I started a little bit into python a few years ago. To say I'm familiar would be to much. But it's an object orientated language - I'll try my best :-) So far, I installed Visual Studio on the Computer with Windows 11 and "run" the program line by line. It stops in sensor.py at line 48 trying to execute import board. Which is an external python module as an inerface for the arduino, if I got this right.
I'd say, tell me what you need / want me to do and I can tell you if I'm familiar enough :-)
P.S. Running scripts from a terminal would be also o.K. for me, I'm not glued to Visual Studio.
The problem is that "import board" loads an external module. So it seems to be a problem with the MCP2221A, not with the Critical Force software itself. Not sure, how we can debug this.
One issue could be, that setting the Environment Variables fails. You could open a terminal and navigate to the folder with the "start.py" script.
Then type the following in the command line:
set BLINKA_MCP2221=1
Next start the script with
python start.py
If that doesn't help, you could check out this documentation, on how to setup the MCP2221A
Setting the BLINKA_MCP2221 to 1 didn't help.
I added a line to sensor.py
print(os.environ['BLINKA_MCP2221'])
right bevor the
import board
which gives me (in a new opened terminal)
>python3 start.py
01 - Set environment variable
02 - Import board
1
So the BLINK_MCP2221 is set alright.
O.k. going to your link:
> set BLINKA_MCP2221=1
> python
>>> import hid
>>> hid.enumerate()
[long list with the MCP2221 in it]
>>> device = hid.device()
>>> device.open(0x04D8, 0x00DD)
>>> import os
>>> os.environ["BLINKA_MCP2221"]
'1'
>>> import board
here comes one beep upper->lower, then lower->upper, then the console stops and isn't accessible any more. The same happens trying to import digitalio.
Okay, thanks for trying this.
Unfortunately, I'm afraid that I'm not able to help you. It seems to be a problem with the MCP2221A.
Could you maybe post your problem in the adafruit forum?
Sorry, I'm very bussy these days, but I will post it in the adafruit forum
If I try to start the program with the weight sensor attached there are two beep sounds but nothing visible happens. The program starts right into the gui without the sensor attached, but with the Warning: "Could not detect weight sensor! Please connect a fingerboard to your computer." Which is correct :-)
If I can do anything to help debug this problem, please let me know.
Ulrich
-- Running on Windows 11 Home Edition 22H2, aktuelle Updates