Coder Social home page Coder Social logo

powtac / autarc_lan_user_stats Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 3.0 422 KB

Autarc LAN/Wifi and Network Device Statistics, by an Arduino UNO with Ethernet Shield (Wiznet w5500).

C++ 14.32% Arduino 42.40% Objective-C 2.45% PHP 36.44% ApacheConf 0.09% HTML 2.55% C 1.75%

autarc_lan_user_stats's People

Contributors

devop1 avatar pctim avatar powtac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

autarc_lan_user_stats's Issues

Can not compile anymore

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

Link names to Mac-addresses

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.

Wrong IP loop count

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

10.0.1.1 -> 216.30.62.47.49.C does not look like MAC Address

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:

  • 0.24.2C.1C.XX.XX
  • 92.59.48.1A.XX.XX
  • 0.19.E3.D3.XX.XX

Availability of Arduino Server

We have to check, if we can reach the Server without having trouble. Otherwise we have to increase the "ServerListenLoop" parameters.

Check duration of one loop

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.

Storage problem

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?

Configuration of the Board

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.

General discussion about Setup/Configuration

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.

Can we determine network information automatically

Is it possible to get some network information automatically before a proper setup of the board? (See #31)

  • Can we figure out the assigned IP address of the board?
  • Can we figure out if an DHCP server is running in the network?
  • Can we figure out what on what gateway the network runs?
  • Can we figure out something about the possible subnets/IP range?

When entering too long config data, it is passed to next input

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

No device -> no HTTP!

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.)

Server functionality - threading

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.

Subnetting

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)

Files to delete

Those files can safely deleted:

  • test_dns
  • client_test
  • Autarc_LAN_User_Stats.cpp
  • Autarc_LAN_User_Stats.h
  • todo.md

Move this part into an extra file config.h or default-config.h or similar

    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';

JSON for device name?

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.

Connection to HTTP Server fails

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.