Is there a way to tell the azsphere cli to use a specific com port? - hc-05

I need to link the azsphere cli to a specific com port on my system. I'm using a Bluetooth <--> Uart device, a HC-05 to configure wifi connectivity on a Sphere project. It would be slick to use the azsphere cli over this connection, but I suspect that the tool is finding the com port based on some com port property.
Is there a way to force the azsphere cli to use a specific com port?
Thanks for any help

There are two different types of UART on the Azure Sphere MT3620 chip.
There are regular UARTs that you can access from your Azure Sphere app. This sample app shows how to use one these UARTs to receive wifi credentials from a BLE chip - the Nordic nRF52 - which sounds similar to the scenario you’re interested in.
There are reserved UARTs that only the Azure Sphere OS can access. When using the MT3620 dev board, they appear as COM ports on your PC but they are only usable by the azsphere CLI: you can’t program them directly. So there is no reason to control which COM port is used - the azsphere CLI is the only user, and it auto-detects which port to use.

Related

Google Smart Home integration with my IoT device (clarification needed)

I am looking for some clarification to how Google Smart Home works.
I am looking to integrate my current end device which control lights with Google Smart Home.
My end device is running a very small microcontroller utilizing an RTOS (Linux is not available)
Here is how I see it (Please correct or comment)
To my understanding this requires me to host my own cloud service
which will talk to my current end device?
My cloud service will then talk to Google cloud service.
My cloud service defines the protocol to talk to multiple end devices
Google Smart Home define the protocol to talk to my cloud service
Questions
Is there any method of doing this without having my own cloud Service?
That is a pretty basic summary of things - yes.
The crucial point there is that issuing a command to the Google Home does not have it send out a message on your local network. Google issues any commands from their network - not from your device.
This might seem like a minor detail, but it doesn't need to be a "cloud service" that you control that Google talks to. It does need to be a publicly accessible HTTPS endpoint. This could be a cloud service (and it would be in most cases), a public non-cloud server, or even just a public URL that has a tunnel to your private network (such as with ngrok).
The last is really how you'd get around having your own cloud service - you can setup the control on a local machine, and have a tunnel using ngrok.
I think a specific example may be beneficial: here's how to connect Google Home to your devices using an intermediary service like IFTTT:
Create a recipe (applet) on IFTTT to connect Google Assistant to an ngrok tunnel using the Webhook service. This permits you to define a simple keyword phrase that the Google Home will recognize (like "Hey Google turn on my device"). The applet will then call a webhook - e.g. ngrok - with a custom command that you get to define (like "https://myngroktunnel.ngrok.io/Control.cgi?mydevice=on" ), where myngroktunnel is your ngrok tunnel address (see below #2) and Control.cgi is the CGI script that you have placed on your microcontroller (see below #3).
You would need to install and run ngrok on your microcontroller: this will connect the IFTTT applet to your microcontroller via the ngrok tunnel and give you a publicly-accessible URL that forwards requests to your microcontroller. You would typically forward your ngrok tunnel to a specific port on your microcontroller where you are running a web server (e.g. Apache) with CGI scripts to control your device. There are other secure tunnel services available on the web: ngrok is just one of them. So, you do not have to host your own webservice, but you do have to use a tunnel to a publicly-accessible service.
The web server that you have placed on your microcontroller has CGI scripts that control your device (for example, let's say you have a Control.cgi script that turns your device on or off, given a command string like mydevice=on, e.g. the hook in the IFTTT applet is "/Control.cgi?mycommand=on"
Of course, the RTOS on your microcontroller muse be capable of running ngrok and a web server - this is why many people have chosen to use a single-board computer like the Raspberry Pi or Orange Pi running a form of linux to host and control their devices. Since your device's RTOS is not linux, I would suggest getting a linux device which would then forward the request to your RTOS device over your LAN.

Passive WiFi detection system using WiFi router

As part of my project requirement I want to make a system which will detect all the WiFi devices in my router range either its connected or not, I did some research on it then I found something like wireshark ,kismate etc I just tried the wireshark by making my Mac machine's WiFi as an adhoc network and its all fine I am able to list all the WiFi devices in wireshark, now I want to make a real-time system based on a real WiFi router I don't know how I will configure my router using my PC and how I will monitor the router from my PC , one more thing if I am using this wireshark how I will use this data for my requirement. If any one worked with similar scenarios please help me..thanks in advance
To do that you will need more than the usual API that you have on commercial WiFi routers (by that I mean a full SSH access). I would:
flash my router with OpenWRT (you can search for your router on this page for detailed instructions)
Install the aircrack-ng suite on the flashed router with
opkg update
opkg install aircrack-ng
Put my WiFi card in monitor mode and run the airodump service:
airmon-ng start wlan0 #Put your NIC in monitor mode
airodump-ng mon0 #Sniff surrounding packets
You don't necessarily have to install aircrack-ng, you can just put your card in monitor mode using command line (look at the documentation for your WiFi driver) and then run tcpdump (command line equivalent to wireshark) but aircrack works very well and has a nice format.
Also, I should warn you that you can brick your router by flashing it. I never had such a problem when flashing router mentioned on the OpenWRT wiki and there are (most of the times) ways to restore a bricked router depending on the brand but I am not responsible if you break it ;)

Controlling GPIB device on remote computer

I am trying to connect to two devices connected via GPIB on a remote computer connected directly via a Ethernet cable. I am using a JPIB library I found, but I am having difficulty determining how to connect to the remote computer.
My goal is to control and read the devices by connecting to the remote computer. I am also unsure as to what program or software I need to install on the remote server.
Thank you in advance,
If you can use the VISA API instead of the GPIB API, install NI-VISA on both computers. On the remote computer, enable the VISA server. You can then use the VISA API to connect to the GPIB device attached to the remote computer.
For example, if the remote computer is at 192.168.0.111, and the instrument address is:
GPIB0::16::INSTR
it can be accessed remotely as:
visa://192.168.0.111/GPIB0::16::INSTR
You can also use a hostname in place of an IP address.
To call VISA from Java, you can use JNA to invoke VISA API functions. A JNA library can be created from a stripped down copy of visa.h (just the functions you need) and even generated with a tool like JNAerator.
This works on Windows. I'm not familiar with the Linux version of NI-VISA>

How to control modems inside a GoIP gateway with AT commands

We have acquired a 4 channel GSM Gateway, model GoIPx4-G610 (the manual is titled "GoIP Series SIM Card for GSM Voice Gateway - GSM VOIP Gateway").
We are looking to develop a custom application to control the GOIP gateway. We have developed in the past custom applications that controlled simple GSM modems through AT commands for sending/receiving SMS messages in particular.
Although the gateway can be controlled through SIP we would like to control the GSM modems embedded in the gateway through AT commands if possible. This is because of the fine grained control AT commands offer and because we do not need VoIP features since we need only to send/receive SMS messages.
The gateway runs an unknown Linux instance to which we can connect through telnet. Unfortunately we do not have the credentials to authenticate to it. The gateway also has a web http administration interface to which we can authenticate but we can't find there settings/information related to channels that we can use for AT commands.
The documentation is very poor and the provider could not offer us any helpful information regarding this.
If anyone knows how we can send AT commands to the modems inside the gateway it is highly appreciated.
Up to now we have tried a brute force attack on the telnet interface to find the credentials with no success. We hope that once we can connect to the Linux instance driving the gateway we can connect from there to the modems through serial connections (to send AT commands) and we can reconfigure it to redirect the connections outside of the modem or to make an interface for sending commands to the modems.
The device has an update firmware option (through the web interface) which always gives the error "download failed". Downloaded the firmware (.pkg file) manually from their update pages and extracted the files from the embedded Linux distribution that should correspond to the ones placed on the gateway. The files were kept in the pkg file as an ROMFS compressed image which we mounted on a test station to see the files (probably the running OS on the gateway is an uClinux distribution).
Did this hoping that we can find there the /etc/passwd file which could be cracked with classic attack. However didn't found it and probably that file is placed on the gateway flash memory (contrary to the Linux files which are stored on the ROM memory). So if there is a way to erase / reset this flash memory that could be a solution (in case the gateway doesn't refuse to boot without those files). Another solution would be to be able to access the flash memory with the passwd file if there is such thing.
You might take the lid off and see what parts are inside.
If it's a general purpose processor with a published data sheet and without a lot of code security features, you might be in luck. For example, you might find:
By guessing headers or tracing from known pins, a console serial port, either logic level or RS232, hopefully with a shell listening
A boot mode pin for the micro connected to a resistor, which you could jumper to cause the micro to boot to a uart bootloader where you could download a new system image, or patch the existing one. If you are lucky the bootloader would be something known, like u-boot.
A JTAG port for the processor
A removable storage device which you could remove and alter
an SPI flash which you could carefully tap into and alter
A flash chip which you could desolder and transplant to a programmer
You could also make a GPL sources request for the kernel and whatever else from the vendor. Or even just trying to identify versions of things like a web server could help you look up any known exploits. Since it seems you have a similar system image to that which is installed, looking through it could be helpful - look for additional daemons running, listening on ports you weren't previously aware of, left over debug support, etc.
I am the developer of the GoIP you've purchased. Instead of trying to hack the GoIP, did you contact us to support your development of custom applications? Here are the updates of GoIP for you.
GoIP now supports SMPP. This could be an alternative to using AT commands to send and receive SMS.
API (Application Programming Interface) for GoIP is now available to support your custom application development.
If AT commands are still the preferred method, please contact us and I would be happy to discuss with you further.

Connect to wireless network

I have created a couple of PowerShell scripts which configure computers used in a training class. Some classes need to connect to a different wireless network (SSID). I can just instruct users how to use the windows XP facilitites to change the network they are connected to but I would like to be able to roll the network selection in to my PowerShell script
Any idea on how to change wireless network in PowerShell?
You might find this project interesting. It is just a .NET wrapper on the native API. You should be able to call this from PowerShell without too much trouble:
http://managedwifi.codeplex.com/