bromagosa / Snap4Arduino

Binding Snap! and Arduino together
http://snap4arduino.rocks
GNU Affero General Public License v3.0
134 stars 85 forks source link

The digital reading bricks do not work anymore. #320

Closed raffoux closed 1 year ago

raffoux commented 1 year ago

Hello, I had abandoned version 7 because of a malfunction of the arduino bricks (instability). The version 6 works very well, I use it with students from 12 to 16 years old with success. I just tried version 8 and it's worse than version 7, the digital reading bricks don't work at all. I am under ubuntu 22.04 and 20.04 with uno cards directly connected in U.S.B. The analog reading and set digital pin bricks work correctly. Jean-Christophe

jguille2 commented 1 year ago

Hi Jean-Christophe

I'm sorry for your problems... but we need more details about your issue.

Version 7 is from January 2022 and version 8 is from January 2023. We have had tens of thousands of downloads, and we are also in some educational distributions, in Moodle plugins and directly online. And yours is the first incidence in this sense!

Also to tell you that we have used the application extensively, in schools and workshops with hundreds of students... and we are not aware of this incidence either. And I'm a Ubuntu user... so it's the most used platform in development testing.

If you want, tell me more details and I'll try to test and reproduce your issues...

Continue...

Joan

raffoux commented 1 year ago

Hi Joan, Indeed, I use a 64 bits version of mate ubuntu. The boards are arduino uno rev 3. Whatever the firmata version used (I tried those provided with version 8), the result is the same. It works perfectly with version 6. I will make other tests. To be continued ...

jguille2 commented 1 year ago

Hi.

Yes, UbuntuMate64 is also my choice :)

jguille2 commented 1 year ago

I will try tomorrow with a fresh install and we can compare...

In parallel, you can test the online version and see...

Continue...

raffoux commented 1 year ago

Hello, the results of my few tests are a bit surprising: (whatever the firmata version)

Uno without shield or with a dupont shield, the 6 desktop and 8 online versions work. The 8 desktop version does not work correctly (digital input) with linux or windows.

Uno + grove shield, everything works whatever the version.

The user is a member of the dialout group. I have no explanation for this.

jguille2 commented 1 year ago

Oh! I'm not sure (maybe I'm doing something wrong) but in a quick test, I see problems with some pins!!

I have to test this better.... but if you are doing the same... Pins until 7 are working fine and I have problems with digital readings on pins upper 7 (8,9...)

Continue... But maybe there is a bug that no one has reported yet?

raffoux commented 1 year ago

Indeed, the inputs from 8 onwards work with the desktop version and on the online version it is the opposite, the inputs work up to 7. I probably used different inputs on each shield.

jguille2 commented 1 year ago

Hi @raffoux

I've done some tests. It's pretty confusing because there are some problems with an asynchronous process (something changed in the response of browsers to the Firmata library) and the Snap4Arduino response to this issue is not clear (it depends on the execution).

I have to test more to see what is the best fix (if I change Snap4Arduino code or I fix that Firmata behavior).

In the meantime:

And I'll fix this for the next minor release (soon). It's strange for me that nobody else had discover this before. I'm using regularly the online version (for workshops) and I hadn't seen it either.

fixdigitalreadings.xml.zip

Joan

jguille2 commented 1 year ago

Hi, @raffoux

I upload now another versions of that "Fix digital readings" block. This one also fixs the watcher reporter. Then you have a workaround to fix this current problem in your projects, and you can start using version 8.

I want to change more things, but I will release a new minor version soon (maybe in a week) to fix this issue you are reported. When fixed, you only will have to remove this block... and then, the "JS activation" will be not required.

Thanks... I will close this issue when releasing... If you see any problem, continue...

Joan fixdigitalreadings.xml.zip

raffoux commented 1 year ago

Hello, Thank you very much for this work, I will be able to use the 8 desktop version with my students. If I encounter another problem, I promise to tell you about it sooner. And thanks again, your software is excellent. Jean-Christophe

jguille2 commented 1 year ago

Hi Jean-Christophe @raffoux

Today I've released v8.2.4. I guess it fixes this issue (over desktop and also online versions).

https://twitter.com/jguille2/status/1660817952265101313

I close this issue. Any problem, continue... Thanks!