Comments (6)
Thanks for your question and the details you provided. The one thing I don't understand is how was the following statement from above is created:
The problematic situation is introduced by starting a Scratch script which has some S3OneGPIO block "Read Digital Pin" from a GPIO pin which is set accidentally output state.
If I go into Scratch and first do a read of an output pin connected to an LED and then write to that pin, all works as expected. If I first write to that pin and then to a read, I can still affect the pin through the write block.
Could you please explain what I need to do to get the system in the state that you describe?
Thanks.
from s3onegpio.
Thanks for your always quick response very much.
I certified again the case carefully. Prior to that, I rebooted the Scratch server and the Browser (in Windows 10 on VirtualBox VM) and the pigpiod server (RasPi).
My conclusion is that the suspect which make S3OneGPIO stuck in a bad condition is S3OneGPIO itself.
My simple procedure to reproduce the incidents that are not accidents follows:
Load and run newly the Scratch script in S3OneGPIO page (http://local:8601).
At first, the state of the GPIO pin in the problem is input and high. This state is set at boot time by a code line "gpio=18=ip,pu" in "/boot/config.txt".
As I push and release a tact switch connected to the GPIO pin, the contact state (low or high) changes correctly in WebIOPi.
When I start the Scratch script, WebIOPi freezes the contact state shown to low. Thus the Scratch script does not work from the beginning.
I can melt the freezed condition when I run the yesterday Python Program. Once melted, the good condition continues and I can rerun the script any number of times successfully.
However, when I reload and run the Scratch script, this good condition breaks.
I suspect that when S3OneGPIO starts a fresh Scratch script, S3OneGPIO changes the state of input pins to output and low. Afterwards WebIOPi and I can never see the changing contact state any more because pigpio does not read from output pins. The reason that WebIOPi cannot see the input/output state is unknown. Furthermore S3OneGPIO blocks are not able to set the input/output state.
More importantly, S3OneGPIO does not change the state of input pin for not-fresh Scratch script.
Anyway I hope the initializing code of Python program helps.
By the way, how to upload my problematic Scratch script?
from s3onegpio.
I am sorry very much.
I want to cancel the previous post and repost the corrected one. I failed to put together the observations.
--- corrected post
I certified again the case carefully. Prior to that, I rebooted the Scratch server and the Browser (in Windows 10 on VirtualBox VM) and the pigpiod server (RasPi).
My conclusion is that the suspect which make S3OneGPIO stuck in a bad condition is S3OneGPIO itself.
My simple procedure to reproduce the incidents that are not accidents follows:
In a fresh (newly read) S3OneGPIO page (http://local:8601), load and run the Scratch script .
Before I run the Scratch script, the state of the GPIO pin in the problem is input and high. This state is set by a code line "gpio=18=ip,pu" in "/boot/config.txt" at boot time.
As I push and release a tact switch which is connected to the GPIO pin, WebIOPi show the contact state (low or high) correctly.
When I run the Scratch script, WebIOPi freezes the contact state to low. My operation to push and release the tact switch does not arrive at the script. Thus the Scratch script which read the GPIO pin does not work.
I can run the yesterday Python Program to melt the freezed condition. Once melted, the good condition continues and I can reload and run the script any number of times successfully.
However, when I reread the S3OneGPIO page, this good condition breaks.
I suspect that when a fresh S3OneGPIO loads and starts the Scratch script, S3OneGPIO changes the state of input pins to output. Afterwards WebIOPi and I can not see the changing contact state any more because pigpiod does not read from output pins. The reason that WebIOPi cannot see the input/output state is unknown. Furthermore S3OneGPIO blocks are not able to set the input/output state.
More importantly, not-fresh S3OneGPIO does not change the state of the input pin when it runs the Scratch script.
Anyway I hope the initializing code of Python program helps.
By the way, how to upload my problematic Scratch script?
from s3onegpio.
I don't know why your config.txt has "gpio=18=ip,pu" in it. This is not set by my software. Below is the config.txt I have on my RPi. You have something in your enironment that set that value. The S3OneGPIO web page does not initialize the state of any pins and neither does s3-extend. The state on the RPi side is set when either a digital read or write block executes in the browser.
I do set the pull up resistor to a pull down state when a digital read block is executed.
Perhaps you can remove or comment out that statement in config.txt and see if things behave as normal, or better yet, reinstall a fresh version the Raspberry Pi OS.
from s3onegpio.
Thanks to you that my trouble is fixed. I apologize for my lack of understanding and confusion.
Following your advice, I added a pull up resistor to the tact switch and replaced "config.txt" file with the Buster original one. Now my trouble is resolved, I think.
Some explanation...
The tact switch is integrated into a ready-made control board which I utilize to build my self-driving toy car. Because adding a pull up resistor was tiresome, instead of that, I inserted the "gpio=18=ip,pu" line into "/boot/config.txt". By the way, "gpio=18" is another mistake and "gpio=25" is correct to be consistent with the Python program.
I did not think that pigpio happens to put back the setting at OS boot time to low (pulled down) state.
Very much thanks to your kind advice and explanation.
from s3onegpio.
I am glad that you were able to solve the problem. No need to apologize for your excellent questions.
The original intent of the RPi extension was to support boards such as the JamHat and PiBrella. Your robot pushed the RPi extension to its limits ;-).
from s3onegpio.
Related Issues (20)
- Firefox not able to open project and do not remember installed extensions. HOT 8
- s3rp crash on latest Win10/ Google Chrome when using read digital pin HOT 4
- Translation for Dutch (NL) HOT 6
- Translation for Japanese (robohat) HOT 1
- Translation for Japanese (playground_express) HOT 1
- Thanks for adoption of translation for Japanese HOT 2
- A simple installation procedure for Windows 10 HOT 1
- Websocket Gateway exited... without pressing ctl+c HOT 6
- How do I create a Blcok program that can be uploaded to Arduino permanently ? HOT 1
- Translation for German (de) HOT 2
- How to read digital input from sensor HOT 6
- The current version of S3OneGPIO fails to compile by "yarn start". HOT 3
- Re: Thanks for adoption of translation for Japanese #43 HOT 2
- Connection to ESP8266 seems to be unreliable HOT 3
- a Japanese translation for the extension "OneGpio Raspberry Pi Pico". HOT 1
- Request to host these extensions in my own Scratch 3 fork HOT 2
- DC motor PWM control backwards HOT 3
- Install s3onegpio extension in fresh Scratch does not work HOT 7
- Does arduino work standalone? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from s3onegpio.