Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add http server code to communicate with PSLab over wifi using ESP #47

Open
neel1998 opened this issue Aug 8, 2019 · 7 comments
Open
Labels

Comments

@neel1998
Copy link
Member

neel1998 commented Aug 8, 2019

Currently, there is no functionality available to communicate with PSLab wirelessly. This issue aims to add server code for wifi communication

@neel1998
Copy link
Member Author

@CloudyPadmal now basic code is there... which other endpoints we aim to add to server?

@neel1998
Copy link
Member Author

Also wont we need a c library like other functionalities so we can connect esp module to pslab and also get voltage data from PSLab and broadcast them over wifi

@CloudyPadmal
Copy link
Collaborator

CloudyPadmal commented Aug 13, 2019

Think about ESP chip as the same UART chip. UART chip has some internal firmware

  • to send data from outside to microcontroller and
  • to send data to outside from microcontroller

Functionality of ESP is the same. It will have an endpoint to write whatever the data we are sending to serial port and read from serial port and send whatever the data coming from microcontroller to outside. No need to do any data processing inside ESP. Only two endpoints are needed (Get and Post). But we can customize and have multiple endpoints to group calls and increase performance. But the basic idea is similar to what the UART chip is doing. ESP will be just an interface.

PSLabModel

@neel1998
Copy link
Member Author

so will need to endpoints as you said... getData() and sendData().... on the ESP side... and from the PSLab android app we will call these endpoints when we want to communicate... for example to get version of PSLab... we will first send (POST request) 11 and 5 to sendData endpoint and then will make a GET Request to getData() to receive the data. Sounds right?

@CloudyPadmal
Copy link
Collaborator

Yes. Sounds right.

@neel1998
Copy link
Member Author

So for now I will keep the post request contain simple json object with one parameter of data having the required byte string. Also from the proposed methods i think the 2nd one seems logical. Creating two flavors would add a lot of redundancy i believe. I will open an issue to add http communication handler in android app.

@Hyperion101010
Copy link

Looks like this project fossasia/labs.fossasia.org#286 is dependent in some way on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants