Skip to content

Mohamed7Khalifa/Smart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Smart 📡

A React Native application to control PIC modules via a Raspberry Pi, which handles communication between the phone and microcontroller.


🚀 Features

  • 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.

📁 Repository Structure

/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

🛠️ Requirements

  • 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).

⚙️ Setup Instructions

1. Raspberry Pi Server

  1. Clone your Pi server repo (if separate).
  2. Install dependencies (pip install or npm install).
  3. Configure serial port to communicate with PIC.
  4. Launch server:
    python server.py
    or
    node server.js
  5. Ensure it's accessible to your mobile app via local IP.

2. Mobile App

  1. Clone this repo:
    git clone https://github.com/Mohamed7Khalifa/Smart.git
    cd Smart
  2. Install dependencies:
    npm install
    # or
    yarn install
  3. Update server URL in src/services/api.js:
    const BASE_URL = 'http://<RPI_IP>:<PORT>';
  4. Run the app:
    # iOS
    npx pod-install ios && npx react-native run-ios
    
    # Android
    npx react-native run-android

📱 Usage Examples

  • 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 under src/components.


🧪 Testing

  • 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.

🧩 Contributing

  1. Fork the repo 🔧
  2. Create a feature branch
  3. Commit and push changes
  4. Open a PR with detailed explanation
  5. Ensure all new code includes tests

📄 License

This project is open-source under the MIT License — feel free to use and adapt it!


💬 Contact

For questions or collaboration, open an issue or reach out to Mohamed7Khalifa via GitHub.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors