-
Notifications
You must be signed in to change notification settings - Fork 808
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
feat: added support for wireless communication using ESP01 #2561
base: development
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis pull request introduces support for wireless communication with the PSLab board using the ESP8266 ESP01 chip. This is achieved by replacing the existing HTTP-based communication with a new Sequence diagram: Wireless communication flowsequenceDiagram
participant App as PSLab App
participant Socket as SocketClient
participant ESP as ESP8266
participant Board as PSLab Board
App->>Socket: openConnection(ip, port)
Socket->>ESP: Connect
App->>Socket: write(data)
Socket->>ESP: Send data
ESP->>Board: Forward data
Board->>ESP: Response
ESP->>Socket: Data
Socket->>App: Return data
App->>Socket: closeConnection()
Socket->>ESP: Disconnect
Class diagram: New SocketClient implementationclassDiagram
class SocketClient {
-Socket socket
-OutputStream outputStream
-InputStream inputStream
-boolean isConnected
-byte[] buffer
-byte[] receivedData
+getInstance() SocketClient
+openConnection(String ip, int port)
+write(byte[] data)
+read(int bytesToBeRead)
+closeConnection()
+isConnected() boolean
+getReceivedData() byte[]
}
note for SocketClient "Singleton pattern for
managing socket connections"
class PacketHandler {
-SocketClient socketClient
+commonRead(int bytesToRead)
+commonWrite(byte[] data)
+close()
}
PacketHandler --> SocketClient: uses
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
@CloudyPadmal Could you please provide feedback on the fact that if the lines on which I'm working here are correct. |
Build successful. APKs to test: https://github.com/fossasia/pslab-android/actions/runs/12518814299/artifacts/2366374704 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @AsCress - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@AsCress I have the required hardware, but I don't know what I need to do to get it working (e.g. how to flash firmware to ESP-01, where to get the firmware). Are there instructions available anywhere? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a much-needed feature! 💯
The demo looks pretty cool and well done @AsCress
@CloudyPadmal Thank you very much ! |
Fixes #2509
Adds support for wireless communication with the PSLab board using the ESP8266 ESP01 chip.
Screenshots / Recordings
2e50f54b-b5b6-424f-a926-9ba1a6ea29c4.MP4
Checklist:
strings.xml
,dimens.xml
andcolors.xml
without hard coding any value.strings.xml
,dimens.xml
orcolors.xml
.@marcnause This PR is now finally updated with all the changes I made. I'll proceed with creating a guide on how to work with the ESP chip after doing a demo of this with you all.
After that, you would also be able to test this new very cool feature 😎.
Summary by Sourcery
Add support for wireless communication with the PSLab board using the ESP8266 ESP01 chip, replacing the existing HTTP-based communication with a new SocketClient implementation for improved performance.
New Features:
Enhancements:
Summary by Sourcery
Add support for wireless communication with the PSLab board using the ESP8266 ESP-01 module.
New Features:
Tests: