A React Native application to control PIC modules via a Raspberry Pi, which handles communication between the phone and microcontroller.
- Remote Control: Operate PIC-based hardware modules from your mobile device.
- Raspberry Pi Hub: Acts as a gateway, managing serial (UART/I2C/SPI) connections to PIC.
- Real-time Status Updates: Monitor PIC module feedback (e.g. sensor readings, LED states).
- Cross-platform Mobile App: Developed with React Native, compatible with both iOS and Android.
/Smart
├── android/ # Android build files
├── ios/ # iOS Xcode workspace and configs
├── src/
│ ├── components/ # Reusable UI components
│ ├── screens/ # App screens (e.g. Dashboard, Settings)
│ ├── services/ # API layers for Raspberry Pi communication
│ ├── utils/ # Helpers and utility functions
│ └── App.js # App entry point
├── package.json # Dependencies & scripts
├── .gitignore
└── README.md # This file
- Mobile App:
- React Native environment (Node.js, watchman, Android Studio / Xcode).
- Raspberry Pi:
- Python 3 (or Node.js) server to interface with PIC modules.
- Setup to receive commands via REST/WebSocket and relay them to PIC serial.
- PIC Microcontroller:
- Programmed firmware supporting command/response protocols (UART/I2C/SPI).
- Clone your Pi server repo (if separate).
- Install dependencies (
pip installornpm install). - Configure serial port to communicate with PIC.
- Launch server:
or
python server.py
node server.js
- Ensure it's accessible to your mobile app via local IP.
- Clone this repo:
git clone https://github.com/Mohamed7Khalifa/Smart.git cd Smart - Install dependencies:
npm install # or yarn install - Update server URL in
src/services/api.js:const BASE_URL = 'http://<RPI_IP>:<PORT>';
- Run the app:
# iOS npx pod-install ios && npx react-native run-ios # Android npx react-native run-android
-
Dashboard Screen:
Offers a UI to send commands (e.g.LED ON,GET TEMP). Displays real-time feedback from PIC. -
Settings Screen:
Configure Raspberry Pi server IP and ports used. -
Custom Components:
Drawer navigation, command buttons, data visualizers are available undersrc/components.
- Use React Native’s built-in Jest framework for unit tests.
- Create mock server responses to simulate PIC behavior.
- Test UI flows using manual or automated tools like Detox.
- Fork the repo 🔧
- Create a feature branch
- Commit and push changes
- Open a PR with detailed explanation
- Ensure all new code includes tests
This project is open-source under the MIT License — feel free to use and adapt it!
For questions or collaboration, open an issue or reach out to Mohamed7Khalifa via GitHub.