Hello,
I was recently making a Web server for the Pyboard-D SF2W + magnetometer.
The software consists of sending a web page for the user to fill, in the indicated fields, the number of measures and the delay between them. The software receives these values and starts recording the sensor's magnetic field readings in a file (.csv). After all measurements are made, it makes the .csv file available for download via the web interface.
The line indicated by the ERROR is responsible for recording the readings in the .csv file (the problem is not in the line, as it normally works in simple reading software without web service).
I can't understand why this "OSError: [Errno 22] EINVAL". Would anyone know if the problem is the code or a board limitation?
PYBD OSError: [Errno 22] EINVAL
Re: PYBD OSError: [Errno 22] EINVAL
Hi,EduardoDestefani wrote: ↑Wed Sep 16, 2020 1:40 pmWould anyone know if the problem is the code or a board limitation?
What you're doing should definitely be possible. Is it possible to share your code (or at least some relevant snippets) to help understand a bit more what might be going wrong? How does the webserver work? Are you using one of the existing libraries (e.g. microdot?)
Thanks
-
- Posts: 4
- Joined: Thu Jul 02, 2020 8:17 pm
Re: PYBD OSError: [Errno 22] EINVAL
I just created a public repository, link to the code ; https://github.com/EduardoDestefani/mic ... er_v0.3.pyIs it possible to share your code (or at least some relevant snippets) to help understand a bit more what might be going wrong?
The Web server consists of; send an html page with fields to be filled in by the user. The completed values (Number of measurements and Delay between readings) are read and passed to the EdgComp part of the code. In this step, Pyboard records the magnetometer readings in a .csv file, when the number of measurements is equal to the number chosen by the user, the file is closed. To download the file, the user must click on "Download readings (.csv)". This action causes Pyboard to send the .csv file in addition to the html.How does the webserver work?
I don't know this library . I am exclusively using the socket and ure to read and send information to the web page.Are you using one of the existing libraries (e.g. microdot?)
Thanks