I have a raspberry pi in my local wifi network. Also I bought smart socket which can be integrated with Alexa or Google Home Assistant. What is a best option to turn the socket on/off from my raspberry?
I thought about installing alexa or google home assistant on the raspberry and somehow use one of these to control my socket. However I don't want to do that by voice but simply a bash script.
It is possible to control the local wifi device with a bash script. You can use ifconfig to bring an interface up/down and configure it accordingly. But, it also depends on the integration of the smart socket with Alexa/Assistant, whether the manufacturer provides their own API endpoints for you to use or whether the user interacts through Assistant/Alexa. If you are using Google Assistant, you can leverage automations on Google Home App to control the device automatically.
Related
I'm using Flutter to create an APP that connects to a WIFI access point. I have used WifiIot to connect to Wi-Fi routers before, but this access point doesn't have a DHCP client, so I need to set the IP manually (I already know how I'm going to manage IP clashes).
I want to do this programmatically - not by having the user set the IP, globally, via settings.
Target platform: Android.
I tried seeing if WifiIot had this capability - Not seeing that it does.
Also looked at other Dart libraries.
I'm in the process of seeing if I can do this with native Android (Kotlin) and maybe call this from Flutter (not my preferred method).
Is it possible (e.g. when developing) to send a pwa to the phone someway e..g. via usb cable without the network and serving it in https?
The use case is development, when maybe a wifi network is not available or unpractical to set up.
If your APP is fully PWA compliant, the app added to home will be an installed APK, which you can extract using file explorer(I used ES File explorer) and put it in other devices using USB connection and adb install myapp.apk for installation.
After you load the apk, it would anyways make calls to your web-server which I'm not sure how it make sense to achieve without network connection though. I couldn't think of any reason to develop a mobile application as PWA without network. You can even have a pass though internet(sharing your desktops internet via USB) by connecting via USB if wifi is not available. But developing PWA with absolute no network mode is not practical.
Update: While you can generate the APK and side load it via USB in the above mentioned way, transferring the cached assets(HTML/CSS/JS/images) might be tricky. You may have to wrap your app as a plain cordova application or Ionic kind of PWA app which uses Cordova to wrap and build with your assets. This way, your APK will be having everything it needs to run for calculator kind of use case.
I like to use ionic servecommand for quick changes I know nothing better than actual device for developing. But I would really like to use just the on-screen device keyboard instead of my computers hardware keyboard, is this possible? I searched in ionic forums and online with no success.
It is not possible, but other option is to use this command (change platform according to your requirement) : ionic run android -l -c
This will run application in you mobile but same like ionic serve, any change on your computer will refresh application in your device.For this your mobile and computer should be on same network. Plus keep mobile connected through usb port while you are running application on mobile. Because all resources are served from computer.
See this answer for more detailed version.
Here is documentation link to live reload app feature of ionic cli.
I wrote an app which runs on two android tablets at the same time. The app enables both devices to communicate with a java server which is running on the pc, via WLAN socket communication.
The problem with the WLAN connection is that it doesn't always seem to be reliable. So I wanted to setup a socket communication to the server via USB cables.
My problem no is how to connect TWO android devices to the server via USB cables. I found this tutorial for connecting ONE device to the server via ADB, but I see no possibility using this approach for two devices:
http://www.anothem.net/archives/2010/10/15/android-usb-connection-to-pc/
Has anyone an idea how to solve it? Thanks!
If your tablet is runs ICS or newer Android OS, then it is very likely that it has OTG capable micro-USB socket, and you can add a USB-Ethernet dongle, and then connect the 2 tablets to your PC over ethernet, instead of USB. This, might be the most elegant solution.
Of course, you'd need a switch (or hub) to connect them together. Also note that, not all USB-Ethernet dongles may work out-of-the-box. You might have to experiment with few models, especially the el-cheapo ones to get them to work.
How would I send a command to a Mac (which has network sharing turned on) over the Wi-Fi network that both it and the iphone is connected to? In my case I want it to open an application.
By network sharing, I assume you are only sharing files. To launch an app, you'd either need to have Remote Login turned on (which would allow Richard's SSH suggestion) or have an application running on the Mac which is listening on a specific port. Your iPhone app would then communicate over this port. Some iPhone apps have a Mac app counterpart (cf. Reach My Files, Here File, File) for the purpose of communicating with the Mac.
How much work are you expecting the user to do when they install your app? Will you walk them through how to turn on Remote Login option in System Preferences under Sharing (in which case, the iPhone app will need to have the user credentials of a user allowed to login remotely), or have them just install an app? The latter is much more user-friendly, but more work on your part.
To actually launch the app, you can use the open command. Type man open for more details, but basically, to launch, for example, iTunes: open -a iTunes.app.