Skip to content

Commit

Permalink
update website with esp32 info and updated arduino script
Browse files Browse the repository at this point in the history
  • Loading branch information
irplus-remote committed Jun 6, 2021
1 parent df0bc65 commit c3548f3
Show file tree
Hide file tree
Showing 10 changed files with 249 additions and 86 deletions.
28 changes: 28 additions & 0 deletions app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
html {
overflow-y: scroll;
}



/* width */
::-webkit-scrollbar {
width: 5px;
height: 5px;
}

/* Track */
::-webkit-scrollbar-track {
background: #f1f1f1;
}

/* Handle */
::-webkit-scrollbar-thumb {
background: #888;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #555;
}


90 changes: 77 additions & 13 deletions bluetooth.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,91 @@
</p>


<p>For this guide we will use an Arduino Uno with a Bluetooth HC-05 serial module. The infrared LED with a Resistor on it's
<p>Variant 1: For this guide we will use an Arduino Uno with a Bluetooth HC-05 serial module. The infrared LED with a Resistor on it's
voltage pin will be attached to a PWM pin (3 as default) and GND. For the connection of the HC05 please check the following
diagram. Note: It could be that you have to use a voltage regulator for the Pin-out! This depends on wether your HC05
has a voltage regulator integrated on it's breakboard or not! Using the Pin-out (5V) without any voltage regulator will
most likely fry your HC05! Also Note: rxPin -> TXD, txPin -> RXD!
</p>
<p>Variant 2: For this guide we will use an ESP32 Module which comes with WiFi and Bluetooth out of the box.
</p>

<div class="row">
<div class="col-6 col-md-6" style="font-size: 20px;font-weight: bold;">Arduino</div>
<div class="col-6 col-md-6" style="font-size: 20px;font-weight: bold;">ESP32</div>
<div class="col-6 col-md-6">
<img src="images/hc05.png" class="img-fluid rounded" alt="Responsive image">
</div>
<div class="col-6 col-md-6">
<img src="images/esp32.jpg" class="img-fluid rounded" alt="Responsive image">
</div>

</div>


<br>


<p class="lead">
Instructions for flashing
</p>


<p>
<img src="images/hc05.png" class="img-fluid rounded" alt="Responsive image">
</p>

<p class="lead">
Software on Arduino
<ol>
<li>Make sure the components are wired up correctly. <i>Common mistake:</i> You do NOT need to connect VCC of IR Transmitter Boards, only DATA and GND!</li>
<li>Download the script for your hardware using the table below</li>
<li><a href="https://www.arduino.cc/en/software" target="_blank">Download</a> and Install Arduino IDE </li>
<li>Install IRremote 3.3.0 using Manage Libraries (Ctrl+Shift+I)</li>
<li>For ESP32 you need to add https://dl.espressif.com/dl/package_esp32_index.json in Preferences and in Board Manager you'llneed to install esp32 and select "Board: ESP32 Dev Module". Make sure you're using the correct COM Port. On Windows to flash you need to keep BOOT pressed.</li>
<li>Open the Script with Arduino IDE and make sure it compiles (Ctrl+R) and after verifying do upload (Ctrl+U). After rebooting the device should be pairable in Android.</li>
<li>Pair your Android with the Bluetooth module (Password: 1234). The name could vary. For ESP32 it is "irplusESP32"</li>
<li>Now start/restart irplusLAN and select the <b>already paired</b> Bluetooth module in the App's settings.</li>
<li>If you press a button on irplusLAN the app will transmit the signal to Arduino via Bluetooth and Arduino will send
the IR signal.</li>
<li>To verify you can as usual use a different phone's camera to see the IR light. Some IR Emitter Breadboards come with an LED light to show activity</li>
</ol>


</p>




<p>
<a href="scripts/irplusarduino.ino" target="_blank">Download the C (*.ino) sketch for Arduino</a>
<br> 1. Upload the script to your Arduino
<br> 2. Pair your Android with the HC-05 Bluetooth module (Password: 1234). Note the HC-05 should be in 9600 baud default
mode.
<br> 3. Now start/restart irplusLAN and select the HC-05 Bluetooth module in the App's settings.
<br> 4. If you press a button on irplusLAN the app will transmit the signal to Arduino via Bluetooth and Arduino will send
the IR signal.</p>
<p class="lead">
Script Downloads
</p>


<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Hardware</th>
<th scope="col">Last updated</th>
<th scope="col">Download-Link</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Arduino</td>
<td>05.06.2021</td>
<td>
<a href="scripts/irplusarduino.ino" target="_blank">irplusarduino.ino</a>
</td>

</tr>
<tr>
<th scope="row">2</th>
<td>ESP32</td>
<td>05.06.2021</td>
<td>
<a href="scripts/irplusesp32.ino" target="_blank">irplusesp32.ino</a>
</td>

</tr>

</tbody>
</table>
Binary file added images/esp32.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 13 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,29 @@

<link rel="shortcut icon" href="favicon.ico">

<link href="app.css" rel="stylesheet" crossorigin="anonymous">

<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">

<title>irplus - Infrared remote</title>
</head>
<body style="padding-top: 56px;">

<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- https://github.com/FezVrasta/popper.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha256-98vAGjEDGN79TjHkYWVD4s87rvWkdWLHPs5MC3FvFX4=" crossorigin="anonymous"></script>
<!-- https://github.com/twbs/bootstrap -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4" crossorigin="anonymous"></script>

<script src="app.js" crossorigin="anonymous"></script>

<div data-include="navbar.html"></div>
<div class="container">

<div data-include="navbar.html"></div>

<div class="contentDiv" style="margin: 30px;">
<div data-include="home.html"></div>
</div>

<div class="contentDiv" style="margin: 30px;">
<div data-include="home.html"></div>
</div>


Expand Down
4 changes: 2 additions & 2 deletions layouting.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="card">
<div class="card-header" id="headingOne">
<h5 class="mb-0">
<button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne">
<button class="btn btn-link" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne">
1. via app user interface
</button>
</h5>
Expand All @@ -25,7 +25,7 @@ <h5 class="mb-0">
<div class="card">
<div class="card-header" id="headingTwo">
<h5 class="mb-0">
<button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false"
<button class="btn btn-link collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseTwo" aria-expanded="false"
aria-controls="collapseTwo">
2. via XML editor
</button>
Expand Down
6 changes: 3 additions & 3 deletions learning.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<div class="card">
<div class="card-header" id="headingTwo">
<h5 class="mb-0">
<button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false"
<button class="btn btn-link collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseTwo" aria-expanded="false"
aria-controls="collapseTwo">
Raspberry Pi and IR receiver connected to GPIO
</button>
Expand Down Expand Up @@ -154,7 +154,7 @@ <h5 class="mb-0">
<div class="card">
<div class="card-header" id="headingOne">
<h5 class="mb-0">
<button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne">
<button class="btn btn-link" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne">
COM/RS232 IR receiver for PC
</button>
</h5>
Expand Down Expand Up @@ -274,7 +274,7 @@ <h5 class="mb-0">
<div class="card">
<div class="card-header" id="headingThree">
<h5 class="mb-0">
<button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapseThree" aria-expanded="false"
<button class="btn btn-link collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseThree" aria-expanded="false"
aria-controls="collapseThree">
Smartphone (Only LG and HTC)
</button>
Expand Down
55 changes: 29 additions & 26 deletions navbar.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<nav class="navbar fixed-top navbar-expand-lg navbar-light bg-light">
<div class="container">
<a class="navbar-brand" href="#" onclick="switchPage('home.html');">
<img src="images/logo.png" width="30" height="30" class="d-inline-block align-top" alt="">
irplus - Infrared remote
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
irplus - Infrared remote</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>

<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">

<li class="nav-item">
<a class="nav-link" href="#learning">New codes</a>
</li>
<a class="nav-link" href="#learning">New codes</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#technical">Technical</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#technical">Technical</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#layouting">Layout</a>
</li>

<a class="nav-link" href="#layouting">Layout</a>
</li>

<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
No infrared port?
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
Expand All @@ -33,20 +33,23 @@
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#trouble">Troubleshooting</a>
</li>
<a class="nav-link" href="#trouble">Troubleshooting</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#beta">Beta</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#contact">Contact</a>
</li>
<a class="nav-link" href="#contact">Contact</a>
</li>
</ul>
<button class="btn btn-outline-success my-2 my-sm-0" type="submit" onclick="window.open('https://play.google.com/store/apps/details?id=net.binarymode.android.irplus', '_blank');">Install</button>
<!--
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>-->
<form class="d-flex">
<!--
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
-->

<button class="btn btn-outline-success my-2 my-sm-0" type="submit" onclick="window.open('https://play.google.com/store/apps/details?id=net.binarymode.android.irplus', '_blank');">Install</button>

</form>
</div>
</nav>
</div>
</nav>
65 changes: 34 additions & 31 deletions scripts/irplusarduino.ino
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
/*Author: [email protected]
* MIT-Licence
* You will need to install this library on your PC before compiling this sketch:
* https://github.com/z3t0/Arduino-IRremote
*/
MIT-Licence
You will need to install this library on your PC before compiling this sketch:
https://github.com/Arduino-IRremote/Arduino-IRremote
Tested with 3.3.0 Installed with Tools -> Manage Library
*/
#include <SoftwareSerial.h>
#include <IRremote.h>
#include <stdio.h>
#include <stdlib.h>
#define rxPin 10
#define txPin 11
IRsend irsend;

SoftwareSerial btSerial(rxPin, txPin);
//----------------------------------------------------------------
int dataPosition = 0;
Expand All @@ -19,39 +20,41 @@ byte dataBytes[dataUpperLimit];
void setup() {
//Serial.begin(9600);//Enable/disable console serial
btSerial.begin(9600);
pinMode(LED_BUILTIN, OUTPUT);
//WARNING: USE THE CORRECT GPIO PIN. HERE 3 IS USED!
IrSender.begin(3, true); // Specify send pin and enable feedback LED at default feedback LED pin
}
//-------------------------------------------------------------------
void loop() {
if (btSerial.available() > 0) {
dataBytes[dataPosition] = btSerial.read();
//stop reading at this point
if(dataPosition > 0 && (dataPosition % 2) != 0 && dataBytes[dataPosition-1] == 255 && dataBytes[dataPosition] == 255){
//create array
unsigned int carrierFrequency = 0;
unsigned int dataBuffer[(dataPosition/2)-1];
int byteCounter = 0;
for (int i = 0; i < dataPosition/2; i++) {
int currentInt = word(dataBytes[byteCounter+1],dataBytes[byteCounter]);
if(i == 0){
carrierFrequency = currentInt;
} else {
dataBuffer[i-1] = currentInt;
}
byteCounter = byteCounter + 2;
}
dataBytes[dataPosition] = btSerial.read();
//stop reading at this point
if (dataPosition > 0 && (dataPosition % 2) != 0 && dataBytes[dataPosition - 1] == 255 && dataBytes[dataPosition] == 255) {
//create array
unsigned int carrierFrequency = 0;
unsigned int dataBuffer[(dataPosition / 2) - 1];
int byteCounter = 0;
for (int i = 0; i < dataPosition / 2; i++) {
int currentInt = word(dataBytes[byteCounter + 1], dataBytes[byteCounter]);
if (i == 0) {
carrierFrequency = currentInt;
} else {
dataBuffer[i - 1] = currentInt;
}
byteCounter = byteCounter + 2;
}
//send IR
digitalWrite(LED_BUILTIN, HIGH);
int carrierKhz = carrierFrequency/1000;
irsend.sendRaw(dataBuffer, dataPosition/2, carrierKhz);
digitalWrite(LED_BUILTIN, LOW);

int carrierKhz = carrierFrequency / 1000;

IrSender.sendRaw(dataBuffer, sizeof(dataBuffer) / sizeof(dataBuffer[0]), carrierKhz); // Note the approach used to automatically calculate the size of the array.

//reset reading data
dataPosition = 0;
memset(dataBytes, 0, dataUpperLimit);
btSerial.write(1);
} else {
dataPosition++;
}
}

} else {
dataPosition++;
}
}
}
Loading

0 comments on commit c3548f3

Please sign in to comment.