uname -r
The kernel version should >= 4.9.4, if isn't, please follow the script below to update kernel:
sudo rpi-updatesudo reboot
In my opinion this is the best way for executing external commands from PowerShell with arguments in a safe manner - via the use of an array to hold the arguments.
Consider this one a PowerShell gem to keep in the toolbox.
Note
The example below makes use of EchoArgs.exe - a small utility that simply echoes back arguments passed to it. Utility is part of the PowerShell Community Extensions, or the exe alone can be downloaded at https://ss64.com/ps/EchoArgs.exe.
| #include <Wire.h> | |
| #define disk1 0x50 //Address of 24LC256 eeprom chip | |
| void setup(void) | |
| { | |
| Serial.begin(9600); | |
| Wire.begin(); | |
| unsigned int address = 0; |
| import socket | |
| UDP_IP = "::1" # localhost | |
| UDP_PORT = 5005 | |
| MESSAGE = "Hello, World!" | |
| print "UDP target IP:", UDP_IP | |
| print "UDP target port:", UDP_PORT | |
| print "message:", MESSAGE |