File tree Expand file tree Collapse file tree 4 files changed +32
-45
lines changed Expand file tree Collapse file tree 4 files changed +32
-45
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ This library is an alternative to the [pubsubclient](https://github.com/knollear
10
10
11
11
[ Download version 1.3.2 of the library.] ( https://github.com/256dpi/arduino-mqtt/releases/download/v1.3.2/mqtt.zip )
12
12
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 .*
14
14
15
15
## Compatibility
16
16
Original file line number Diff line number Diff line change 1
1
#include < Bridge.h>
2
- #include < YunMQTTInstall .h>
2
+ #include < Process .h>
3
3
4
4
void setup () {
5
5
Bridge.begin ();
@@ -8,7 +8,36 @@ void setup() {
8
8
while (!Serial);
9
9
delay (1000 );
10
10
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!" );
12
21
}
13
22
14
23
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
+ }
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments