Skip to content

Commit 566fe08

Browse files
committed
move install script full to example
1 parent 09e2f59 commit 566fe08

File tree

4 files changed

+32
-45
lines changed

4 files changed

+32
-45
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This library is an alternative to the [pubsubclient](https://github.com/knollear
1010

1111
[Download version 1.3.2 of the library.](https://github.com/256dpi/arduino-mqtt/releases/download/v1.3.2/mqtt.zip)
1212

13-
*Or even better use the newly available Library Manager in Arduino.*
13+
*Or even better use the newly available Library Manager in the Arduino IDE.*
1414

1515
## Compatibility
1616

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include <Bridge.h>
2-
#include <YunMQTTInstall.h>
2+
#include <Process.h>
33

44
void setup() {
55
Bridge.begin();
@@ -8,7 +8,36 @@ void setup() {
88
while (!Serial);
99
delay(1000);
1010

11-
YunMQTTInstall();
11+
Serial.println("Starting Installation!\n");
12+
13+
run("Update", "opkg update");
14+
run("Install 'easy_install'", "opkg install distribute");
15+
run("Install python SSL support", "opkg install python-openssl");
16+
run("Install 'pip'", "easy_install pip");
17+
run("Install 'paho-mqtt'", "pip install paho-mqtt");
18+
run("Download script", "wget https://raw.githubusercontent.com/256dpi/arduino-mqtt/yun-client/yun/client.py --no-check-certificate -O /usr/client.py");
19+
20+
Serial.println("Installation finished!");
1221
}
1322

1423
void loop() {}
24+
25+
void run(const char *name, const char * cmd) {
26+
Serial.print("=== ");
27+
Serial.println(name);
28+
29+
Serial.print("--> running '");
30+
Serial.print(cmd);
31+
Serial.println("'");
32+
33+
Process p;
34+
p.begin(cmd);
35+
p.runShellCommand(cmd);
36+
37+
while (p.available() > 0) {
38+
char c = p.read();
39+
Serial.print(c);
40+
}
41+
42+
Serial.println("--> finished!\n");
43+
}

src/YunMQTTInstall.cpp

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/YunMQTTInstall.h

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)