How to set wifi to Android Things without an ethernet cable or adb [closed] - android-things

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I'm interested in knowing how to set the first wifi on android things (not android phone) without access to a network cable, for a fresh install.
There certainly must be a way to put the information in the SD card right after copying the OS image. If that can't be done directly, worst case scenario I would expect it should be possible to write a script and copy it somewhere into some of the partitions and have it automatically run at boot (which can be handy for other things). Unless the image is signed?
I would also be ok by writing an app that could be copied to SD card before first boot that would be auto-installed and do that thing for me. I would know how to write the app, but so far I don't know how to do the copy/autoinstall/autorun thing.
I would also be ok having one device connect to network and configure wifi, then clone its SD card into another one.
What really gets in my way is having to get a network cable every time I prepare a new SD card.

You should be able to add your wifi configuration at the end of /data/misc/wifi/wpa_supplicant.conf.
network={
ssid="SSID"
key_mgmt=WPA-PSK
psk="PASSPHRASE"
}
This should be located on the data (ext4) partition of the sdcard (for me /dev/sdb15)

You can use:
adb connect Android.local
to connect to Android Things PC (Raspberry PI3) and then just set up your WiFi like described in Android Things tutorial:
$ adb shell am startservice \
-n com.google.wifisetup/.WifiSetupService \
-a WifiSetupService.Connect \
-e ssid <Network_SSID> \
-e passphrase <Network_Passcode>
https://developer.android.com/things/hardware/raspberrypi.html

Related

Nat Punchthrough understanding P2P concept [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
The community reviewed whether to reopen this question 4 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
So, i have been reading up on NAT-Punchthrough. I seem to be getting the idea, but i have a hard time implementing it, and i feel that i am missing a step here.
Testing this functionality is kind of hard because i have little control over the environment when it comes to a internet based connection.
I have a SQL server to run as my "facilitator" it keeps the external address of both server and client, and their port as seen by the outside.
Here are steps so far:
- I connect to my SQL server through a web request (PHP script) that stores server/client IP/PORT
- When both are known, both client and server attempt connecting (server hosts on a set port, client connects over a set port)
- Nothing significant happens
There are 2 unknowns here, and i would like to check one with you.
Is it true that NAT-Punchthrough requires that i do the first step with the exact (internal/LAN) port i plan to connect with in the step after that?
If so, i don't know how exactly my server works underwater, so it might need more ports then my initial given static port to connect over, but that at least gives me a hint.
If anyone has more documentation on this then me, please let me know.
Sources:
Programming P2P application
http://www.mindcontrol.org/~hplus/nat-punch.html
NAT punch through works on the principle of educated guesswork. It is usually used to create connections with devices that do IP Masquerading. This is the technology used in most home internet modems to the point that NAT has become interchangeably used to refer to IP Masquerading.
When you connect out from a device which is behind a NAT system like a home modem. You have no control of the port that will be used for the outbound connection to the Internet. However many of these devices allocate ports using specific patterns. For example, incremental numbers.
NAT punch through involves trying to directly connect two source systems that are both behind independent NAT devices. A third system, your "facilitator" acts as a detector for the origin port numbers currently being assigned by both NAT devices on outbound connections. The origin port number, along with the IP address is then sent to the other parties.
So now the clever bit to answer your question. Both systems that want to directly connect, start trying to communicate to the other. They try connecting to a range of ports, around the known port number detected by the facilitator. This is the guesswork.
It is important that both source systems start trying to connect as this will establish NAT sessions in the local devices that allow traffic from the Internet in. If either source device correctly guesses one of those NAT session port numbers, then a connection is established.
In reality, engineers from organisations that have use for NAT punch through have probably spent some time examining the more popular NAT port allocation algorithms and tuning their software. If you have control of connections through your NAT devices, then it would be fairly easy to set up some tests and see how the port numbers change between connections to different servers.

Intercept serial port data in Delphi [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I know how to comunicate over serial port using TComPort, but I'd like to view the data going in and out a virtual (USB<=>RSR232) COM port without interupting the transmition and (obviously) opening the port. To be precise I want to see the GPS data from the USB GPS receiver.
The thing is that I need to apps using the same data at the same time. My Delphi app and the navigation software. The alternative would be to have the decent PC navigation software with Europe maps (open street map would also be fine, but can't find any decent car navigation software) that has good API whci can return the GPS position.
Any ideas are welcome! :)
Thanks!
G.
Use the com0com device driver in conjunction with hub4com.
From documentation:
In conjunction with the com0com driver the hub4com allows to
handle data and signals from a single real serial device by a number of
different applications. For example, several applications can share data
from one GPS device;
Example:
GPS hub
You have a GPS device that connected to your computer via a physical COM1
port and you'd like to handle its data by two GPS applications. You can
do it this way:
With the com0com's Setup Command Prompt create COM5<->CNCB0 and
COM6<->CNCB1 virtual COM port pairs (see com0com's ReadMe.txt for
more info). For example:
command> install 0 PortName=COM5 -
command> install 1 PortName=COM6 -
Start the hub4com.exe on COM1, CNCB0 and CNCB1 ports:
hub4com \\.\COM1 \\.\CNCB0 \\.\CNCB1
It will send data received from COM1 port to CNCB0 and CNCB1 ports
and it will send data received from CNCB0 port to COM1 port.
Start the GPS applications on COM5 and COM6 ports.
You can use PortMon utility by Mark Russinovich
Advanced Serial Port Monitor can monitor USB COM port too and works on Windows 7,8 64 bit.
http://www.aggsoft.com/serial-port-monitor.htm
Note: you should use the SPY mode in ASPM.

How to make my laptop an App server? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I developed an internet-based IOS app,and my app communicates with the server through html requests.
It works perfect when I test it locally. But when I test it through the internet,it seems the html requests can't be received by the server.
I am using my Mac Pro as the server ,and the laptop is connected to the internet via the same wifi as the my iPhones.
So,how can I make a laptop connected to internet via wifi an server?
There are a lot of complications to making something available on the internet from a home machine, and it's not clear from your problem statement where the problem lies. Here are some of the most common gotchas:
Check that the server is accessible from another computer on the same local area network as the server (leave the iOS device out of it at firs - if not, the server is misconfigured. Check firewall settings on the server.
I understand that you want this accessible from devices outside the local area network (ie, you want it to be usable from anywhere, not just your home network). For this, you must configure your router to forward the appropriate port (probably 80, depending on the server software you're using) to the server. This is called "Port Forwarding" or other similar names (depending on the router manufacturer); consult the documentation for your router for information on how to enable it, as the process varies between make and model. Note that some ISP's supply a cable/dsl modem that has it's own firewall in it (for example, comcast business class does this), so you may also have to set up port forwarding on that as well.
You need to specify the external IP address of the server (you can use whatsmyip.com or similar to find it) when connecting to it over the internet, not the LAN IP.
As everything is working locally, the problem is located in the device linking your laptop to the internet : your internet box.
By default, when it receives request from outside, your box will reject them, because this is a security risk (it could allow anyone to access your private network server, and if there is a security breach in a member, this could be a real problem). Moreover, your box has most of the times more than on device connected, so how can it know which device the request it gets is for?
Luckily, there is a way to tell your box "Hey! If you receive a request on this port, forward it to my laptop!". It is called port forwarding. This is quite difficult to explain as every ISP has a different implementation of this. But to set this, you have to connect to your box's administration interface and look for the section related to port forwarding.
Once you're there, you will have to set the port (if you run an HTTP application, it is 80 for example), a protocol (use both in doubt), and finally the destination IP. This is the IP of your computer on the local network. You can get it using ipconfig on Windows.
Once you have set your forward rule, you should be able to acces your app from the internet using either a Dynamic DNS service, or your Internet address, which you can get from websites such as http://www.whatismyip.org

Find wifi enabled devices [stations] around [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 12 days ago.
Improve this question
Imagine this situation that there are some smartphones and computer around with their WiFi adapter (wireless adapters) on, but not necessary connected to a network.
Is there a way to look the MAC addresses via a Linux machine?
Any insights are appreciated.
Disconnected clients aren't always silent. In fact, more often than not, clients send out directed and broadcast probe requests searching for access points they have connected to previously, thus revealing their MAC addresses which can be displayed through airodump-ng or by filtering capture packets in Wireshark to display probe requests.
This is the suitable Wireshark filter:
wlan.fc.type_subtype eq 4
Old question, but i'll have a go anyway.
Wifi enabled devices usually send probe requests to try to find Access points they previously have been connected to, even when they are nowhere near them.
If you're using backtrack/kali linux, try this:
Create a wireless adapter alias running in monitor mode (assuming your adapter name is wlan0):
airmon-ng start wlan0
Start scanning for devices and access points:
airodump-ng mon0
The access points will be listed first with their Mac addresses under "BSSID", followed by the devices which will have their MAC addresses listed under "STATION" and a "not associated" flag under "BSSID" if they aren't connected to an access point.

Windows Service can't access network share [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
The community reviewed whether to reopen this question 1 year ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I have a windows service running on my local machine. It's configured to run under NT AUTHORITY\NETWORK SERVICE. The program access a network shared drive on a computer in the same subnet. That shared directory has Everyone set to Full control.
I'm getting False on File.Exists, but the file exists. I'm certain this is a permission issue. Am I forgetting anything? Note, the computer with the shared drive is not on a domain.
Solution was found here:
https://serverfault.com/questions/177139/windows-service-cant-access-network-share
The fact that the machine with the shared drive is not on a domain is where your main problem is. In order to get this to work you will have to configure the Windows Service to run as a specific user, and then you'll have to create an identical user on the remote system with the same password. It might work then.
The problem stems from the fact that in order to log in to a machine not in a domain, you have to log into that machine using an account that exists on that machine. The machine account for something else definitely won't exist on that local machine. By creating an identical user with an identical password, you might be able get the login to work."
-sysadmin1138
I created identical accounts on both machines and the service account was able to access the shared drive. Having the servers on the same domain is a better solution, so I'm working towards that, but this will work in the mean time.
Brian T was correct. But I would like to add something. We had this problem even though the service was running on the same DOMAIN\User. Our service was trying to write a file to a shared folder/drive and it was configured in the config.xml like so:
I:/path/to/the/file/to/write.
But when we changed the config to use IP-address of the network instead of drive letter, we managed to fix the issue. However the syntax changed a bit:
\\xxx.xxx.xx.xx\path\to\the\folder\to\write
Hope this helps anyone who still haven't solved the problem
Setting the share permissions is not enough. Also set the NTFS permissions adequately, then it'll work. Everyone Full Control on the share means, everyone can get through the network to the root of the share but from then on NTFS rights are used to determine what is allowed and what not.

Resources