powtac / autarc_lan_user_stats Goto Github PK
View Code? Open in Web Editor NEWAutarc LAN/Wifi and Network Device Statistics, by an Arduino UNO with Ethernet Shield (Wiznet w5500).
Autarc LAN/Wifi and Network Device Statistics, by an Arduino UNO with Ethernet Shield (Wiznet w5500).
Get ideas of how to parse mac addresses from PEAR?
C:\Users\asdf\AppData\Local\Temp\build4447524517962612811.tmp\autarc_lan_user_stats.cpp.o
autarc_lan_user_stats.ino:1039:0: error: unterminated argument list invoking macro "F"
autarc_lan_user_stats.ino: In function 'void ServerListen()':
autarc_lan_user_stats.ino:984:30: error: 'F' was not declared in this scope
autarc_lan_user_stats.ino:984:30: error: expected ';' at end of input
autarc_lan_user_stats.ino:984:30: error: expected '}' at end of input
autarc_lan_user_stats.ino:984:30: error: expected '}' at end of input
autarc_lan_user_stats.ino:984:30: error: expected '}' at end of input
autarc_lan_user_stats.ino:984:30: error: expected '}' at end of input
autarc_lan_user_stats.ino:984:30: error: expected '}' at end of input
My idea was to add an mysql-database with the AVR-ID, all Mac-addresses and the user specified names.
We have two options to assign the names: First, all users can select their Mac-Address on the server website and enter a name - it's the easier way.
Or secondly, the professional one, the user sends a http request to the Arduino. On the website provided by the Β΅C the user can enter his name, which will be send to the server.
After configuration this shows up. It looks like the loop IP range was calculated wrong: 10.1.1.1 - 10.0.1.254
Configuration finished
Using configuration from EEPROM.
Try to get IP address from network...
MAC address of shield: 90:A2:DA:0:46:8F
Address assigned?
10.0.1.3
255.255.255.0
Setup complete
Speicher: 93
Starting loop trough IP range 10.1.1.1 - 10.0.1.254Speicher (Loop-Start): 93
Speicher (Ende ServerSend): 93
Restart loop
Speicher (Loop-Start): 93
Speicher (Ende ServerSend): 93
Restart loop
Speicher (Loop-Start): 93
Speicher (Ende ServerSend): 93
Those are my addresses:
Physikal. Adresse Transportname
=================== ===============================
00-17-F2-D0-XX-XX Medien ausgeworfen
00-19-E3-D3-XX-XX Nicht zutreffend
41-56-45-00-XX-XX Nicht zutreffend
06-19-E3-D3-XX-XX Medien ausgeworfen
Nicht zutreffend Hardware nicht vorhanden
00-17-F2-BA-XX-XX Medien ausgeworfen
Working devices:
See http://de.wikipedia.org/wiki/JSON#Beispiel for an example.
We have to check, if we can reach the Server without having trouble. Otherwise we have to increase the "ServerListenLoop" parameters.
How much time needs a 255.255.255.0 loop?
Maybe we have to improve our code to decrease this time. e.g. use only 2 pings, instead of 4.
As it seems yet, we have a storage problem for all the Mac-addresses. I see two options: First, we only check if the devices are available. After we have checked all the possible addresses we ping them another time to get their Mac address and send every address as a single one to the server.
The second option is, that we only check e.g. 64 devices and save their mac address (if they are available) and send the result to the server. After that we scan the next 64 devices and so on...
I think the second one would be the better one, because we don't have to ping devices two times and so we only need the half time.
What do you think?
The configuration of the Arduino (e.g. the manual IP, manual Subnetmask, Server URL, Ping-Timeout, Board-ID, ...) should be stored in the EEPROM.
After Reset the configuration happens over RS232.
The goal is to make it as easy as possible to setup a new Autarc LAN Scanner. Those information are needed to run the Scanner:
Parameter | Device/Hardware specific? | Networks specific? | Required? | Can be set in advance? | Description |
---|---|---|---|---|---|
MAC address | β | π΄ | β | β | Printed on hardware |
Assigned IP address | π΄ | β | ? | π΄ | Given by local router |
Gateway | π΄ | β | ? | ? | |
Subnet | π΄ | β | ? | ? | |
Use DHCP | π΄ | β | ? | ? | |
Nr of pings | π΄ | π΄ | ? | β | IS this pingrequest ? |
Use Subnetting | π΄ | β | π΄ | β | |
IP range | π΄ | ? | β | ? | |
Key for Server storage (AVRID) | π΄ | π΄ | β | β | A short string that identifies the scanner, like "Tim00" or "Simon" |
The column "Required" shows if we really need the value of this parameter. This means we could omit all the other values and set default values if we can.
@PcTim can you check what can be set for the missing ("?") values of the "Required" column? I want to use this matrix to figure out what can be improved in the setup.
Maybe the array code is broken?
Habe ein paar Links in die https://github.com/powtac/Autarc_LAN_User_Stats/blob/master/resources.md eingefΓΌgt!
Should we send the password with MD5?
https://github.com/tzikis/ArduinoMD5/
Is it possible to get some network information automatically before a proper setup of the board? (See #31)
I've read an article about the Arduino Ethernet Library. Maybe it helps us: http://code.rancidbacon.com/LearningAboutArduinoEthernet#ReducingamountofdatatransferwithofficialArduinoEthernetLibrary71
http://forum.arduino.cc/index.php/topic,47994.0.html
--------------
Your account data:
srvID
srvPSW
--------------
When entering in the configuration a string that is longer than the expected value, it's end will be used for the next value:
Example with input value: "1234567890123456789012345567890"
Press any key start configuration...Starting configuration
MAC Board, format "00:00:00:00:00:00":
12345678901234567
FF:0:0:0:0:0 stored
IP Board, format "000.111.222.333":
89012345567890
It is common to use the max available baud speed.
Only found devices should be send to server. This is my understanding.
So the server only collects WHEN and WHAT device was online. But not when it was not. (So it is more like a heartbeat service...) You will not know if a device is AT THE VERY MOMENT online but for example that it was successfully pinged 3 minutes ago.)
I really would like to improve some things...
Can we implement a command to reset/empty EEPROM?
By counting the unique MAC addresses, the total number of different devices on the network can be found.
If the HTTP server is offline, we will get no ID, so we have to exit the loop.
If the ethernet line is plugged off or we loose connection because of a new IP address, the board won't reconnect.
We should have the opportunity to use multi-threading with the arduino.
One Thread for the ping function and one for the servers listen loop.
But mutlithreading isn't really supported...
I solved this bug for test reasons with a loop... But it doesn't work save enough.
Do we need to change the servers URL in the advanced setup?
The board shouldn't ping itself and the gateway. But send the IP and Name to the Server.
Should we scan only devices in the Subnet of the Arduino, or should we scan the whole network? (e.g. we have a subnetmask with 255.255.192.0, we have 4 subnetworks)
Those files can safely deleted:
mac_shield[0] = 0x90;
mac_shield[1] = 0xA2;
mac_shield[2] = 0xDA;
mac_shield[3] = 0x00;
mac_shield[4] = 0x46;
mac_shield[5] = 0x9F;
ip_shield[0] = 192;
ip_shield[1] = 168;
ip_shield[2] = 178;
ip_shield[3] = 98;
gateway[0] = 192;
gateway[1] = 168;
gateway[2] = 178;
gateway[3] = 1;
subnet[0] = 255;
subnet[1] = 255;
subnet[2] = 255;
subnet[3] = 0;
useDhcp = 1;
pingrequest = 2;
useSubnetting = 1;
start_ip[0] = 192;
start_ip[1] = 168;
start_ip[2] = 178;
start_ip[3] = 2;
end_ip[0] = 192;
end_ip[1] = 168;
end_ip[2] = 178;
end_ip[3] = 254;
AVRID[0] = 'T';
AVRID[1] = 'i';
AVRID[2] = 'm';
AVRID[3] = '0';
AVRID[4] = '0';
AVRID[5] = '\0';
Should we add a setup page on the arduino server?
According to the latest requests, the expected time of the next update could be shown (in a countdown?).
Kannst du das bestΓ€tigen?
Maybe we should change the communication for the Device-Input Form also to JSON?
The disadvantage is, that we need to use ajax. The advantage, that we can handle this request like the new device request.
Simple MD5 hashing? But maybe still submit the first 4 octets of the MAC to identify the vendor?
I have the problem that the connection to the Server doesn't work reliable.
Also the DHCP-Server fails. I'm not sure if it's a hardware problem.
Has anybody the same problems?
At the end of the network hardware setup, tell the user to
"Visit http://10.0.1.5/ with your browser to add a name to your first device. Tell all users to do the same.
Also check out http://lan-stats.danit.de/?AVR_ID=Simon to see your stats online!"
In the Serial monitor "GerΓ€te" is wrongly displayed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.