Pages: 1 2 [3]   Go Down
Author Topic: Arduino Network causing severe battery drain on WiFi connected devices.  (Read 2746 times)
0 Members and 1 Guest are viewing this topic.
Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
You'll understand if I blank out some of the IPs

Sure, didn't expect anything else.

Quote
So it's obviously bridged the relevant devices (giving br0). At this point I'm getting scared to bugger around with it

No reason to get scared. At this level (without saving anything) if anything goes wrong, just unplug your router from power and replug it, it will boot in a state as it was before.

We have to split the WLAN interface from the bridge. The command f

or this is:

Code:
brctl delif br0 <wlan-interface>

where <wlan-interface> stands for the name of the wireless interface. The command

Code:
iwconfig

should give you the list of your interfaces, all marked "no wireless extensions." are not of interest. You probably have only one with more information, that's your WiFi interface.

Before you split the bridge with the above command, issue the following command to activate ip forwarding (router functionality). Although this is probably already the case, it's just a precaution.

Code:
echo "1" > /proc/sys/net/ipv4/ip_forward

If you've done this, your WiFi interface should be in a separate segment. We still need to configure ip addresses and we have to check what netfilter rules are active.

To do all the commands be sure to use one of the ethernet ports on the router, do not use your WLAN for that, because that might be interrupted during the commands.

If you've done the above, please post the output of the following commands (again: changing public IPs to placeholders is perfectly viable):

Code:
ifconfig

iptables -L -n
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 146
Posts: 6019
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
No reason to get scared. At this level (without saving anything) if anything goes wrong, just unplug your router from power and replug it, it will boot in a state as it was before.
Not true with all routers. If I modify a setting, there is no need to save. Unless I am in safe mode, the change is immediate and permanent. Good thing I have a serial port to access the router to get the default config back.

Otherwise, it is no big thing as long as you can afford a new one.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah I've changed other things on this router and changes like this are usually persistent. For example I've changed the brightness of the LEDs by simply piping numbers into the right /dev and it stays that brightness after a reboot.

If this weren't a router that I need all the time for my job I'd be more than comfortable messing around with it, but I have concerns - for example br0 is mentioned in various scripts on the device - so what happens when the web interface tries to configure stuff using these scripts that reference br0? If the bridge is split, that means there'll be two separate devices to configure but again the web interface only expects one.

There's also another problem in that I actually do need to receive some broadcasts onto my Wireless devices. For example I use an app on my phone that monitors log server broadcasts for stuff :/

I really wish there was a way to fix the Arduino side of this.
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 146
Posts: 6019
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I really wish there was a way to fix the Arduino side of this.
I do not see where the library code is involved with an ARP broadcast. I still believe that is accomplished by the firmware in the w5100.

You can check. The library code from Wiznet and Arduino is available as source code in your IDE.
/libraries/Ethernet/
and
/libraries/Ethernet/utility/
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Not true with all routers. If I modify a setting, there is no need to save. Unless I am in safe mode, the change is immediate and permanent. Good thing I have a serial port to access the router to get the default config back.

This is probably the case if you use the Web interface for configuring things. But if you use the command line I haven't seen a device yet that automatically saves that in a non-volatile storage.

Quote
Yeah I've changed other things on this router and changes like this are usually persistent. For example I've changed the brightness of the LEDs by simply piping numbers into the right /dev and it stays that brightness after a reboot.

I didn't write you should reboot the device but unplug from power. That way there's no possibility to shutdown the device and store current settings in EEPROM or flash.

Quote
for example br0 is mentioned in various scripts on the device - so what happens when the web interface tries to configure stuff using these scripts that reference br0? If the bridge is split, that means there'll be two separate devices to configure but again the web interface only expects one.

After doing such stuff on the command line you shouldn't use the web interface to configure the device. I just wanted to give you an opportunity to use your current device and have the segments separated.

I don't see a chance to change anything on the Arduino side. Embedded devices usually don't have enough memory to cache an ARP table.
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 146
Posts: 6019
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
This is probably the case if you use the Web interface for configuring things. But if you use the command line I haven't seen a device yet that automatically saves that in a non-volatile storage.
I have used many brands of routers, and now I use MikroTik routers. They work really well. I do not use the web interface. I am a CLI kinda guy. Here is a topic on another forum that describes what I do when I lock myself out of one of my remote routers:
http://forum.mikrotik.com/viewtopic.php?f=2&t=29388&p=142934&hilit=curse#p142934
Without the serial cable, the router would be bricked.

Unless you are in safe mode, the changes are immediate and permanent.
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is that MikroTik router running Linux? It doesn't look like to me. If I change configuration file that are stored in the flash file system changes are permanent. But by just issuing commands to devices I just change a state and this state-change is volatile.
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 146
Posts: 6019
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I believe it is a highly modified Linux, but that is really not the point. The OP stated that he changed a setting, and without saving anything, it kept that setting through a reboot. That is a good sign that it is saving that setting without a "save" command.
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's a good sign that it save it during a reboot but not on a power cycle. The commands I posted are standard Linux commands, none of them is saving anything. But the OP doesn't seem to be interested, so we're just loosing time here.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Changes made are saved in a device mapped off /dev/nvram, which I assume is "Non-volatile RAM". All changes you make on this router are persistent even after a power cycle.

But yes, I don't want to waste anyone's time. I'm not comfortable messing around with this router like that, especially given the references to br0 in so many places.

If there's no way to fix it from the Arduino side I'll "borrow" a router from work and if that fixes it stick with that.

Seriously though - this thread has been very valuable to me, and I greatly appreciate everyone's help.
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 146
Posts: 6019
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
But the OP doesn't seem to be interested, so we're just loosing time here.
Better than losing money. I would not recommend anything that might brick a customer's router.

I agree with you, Vincent.
Logged

Pages: 1 2 [3]   Go Up
Jump to: