Doodle3D / doodle3d-client

The Doodle3D web interface that people can access on computers or tablets to draw doodles and control the Doodle3D WiFi box.
www.doodle3d.com
GNU General Public License v2.0
3 stars 8 forks source link

Wireless printing in client mode hangs while in AP mode works ok #216

Open peteruithoven opened 10 years ago

peteruithoven commented 10 years ago

By @randomev: I have experienced many times failed prints when printing in wifi client mode. I use Doodle3D along with Cura to print wirelessly.

I suspect that Doodle3D disconnects from my router every once in a while.

I printed the same 4 hour print many times and it usually hangs in some way if I print it while connected to my workshop wlan in client mode.

This does not occur if I print it in AP-mode, eg. Doodle3D is creating it's own wifi-network. I have now printed 2 times that 4 hour print and both prints went just fine.

So I suspect that if Doodle3D is connected to wifi in client mode and wifi disappears / disconnects, Doodle3D will stop printing. It would be nice that printing would continue even if network connection is temporarily lost.

peteruithoven commented 10 years ago

@randomev I've had the same experience with some longer prints, but we haven't had the time to look into it. You're research might already be a step into the right direction, thanks for that. Since the box operates independently of a connection and the connection should not influence the driver (unless of course you are still sending the print) I can't explain this right away, we'll look into it. I have two logs of my own where it hang, but you're welcome to share the logs when you run into issue's that helps us a great deal in finding the issue. http://doodle3d.com/help/faq#113

peteruithoven commented 10 years ago

After quite a few tests this seems a complicated issue.

It happens when it loses the whole network (by turning of the router the WiFi-Box is connected to). It doesn't happen when you turn off the wifi on the box wifi down or disconnecting just the internet from the router (by turning of off 3d etc when it's connected to the AP of my mobile). It even happens when using a USB hub. I don't even request a signin. There are no interesting messages in logread or wifibox.log. The printer just stops communicating back. When you reconnect the printer it still won't communicate, you need to reboot the WiFi-Box. It also happens on a non encrypted network. What I find weird is that wpa_supplicant seems to be running, even though I'm not connected to a encrypted network.

peteruithoven commented 10 years ago

Even after a lot more experiments the cause of this issue remains unclear. We are trying to update OpenWRT (the operating system installed on the box).

peteruithoven commented 10 years ago

There is some activity in the topic we found earlier about usb stability, maybe this can provide insights. There is talk about an issue caused by scanning for wifi networks. https://forum.openwrt.org/viewtopic.php?pid=231350#p231350

peteruithoven commented 10 years ago

Turning the usb power on and off (see below) usually works, but it doesn't last when the network is still down. Probably because wifi is still scanning.

echo 0 > /sys/devices/virtual/gpio/gpio8/value
echo 1 > /sys/devices/virtual/gpio/gpio8/value

When you also turn wifi off (wifi down), this does work.

peteruithoven commented 10 years ago

From the iw documentation:

You can use iw to connect to an AP directly if and only if the AP has:
- No encryption
- Uses WEP for encryption 

It however should be noted that if you disconnect from the AP, which can happen quite frequently on a busy environment, you will need to reissue the command. If you do not want to do this you can just use wpa_supplicant which will automatically try to reconnect you when you get disconnected.

If you do choose to deal with disconnects yourself you can use iw connect as follows.
To connect to an AP that has encryption disabled, where its SSID is foo:
iw wlan0 connect foo

More: http://wireless.kernel.org/en/users/Documentation/iw#Establishing_a_basic_connection

So maybe we could find a way to use iw instead of wpa_supplicant. This probably involves more manual configuration. And the fact that it tries to reconnect to it's network is actually a nice thing.

peteruithoven commented 10 years ago

Posted my idea: https://forum.openwrt.org/viewtopic.php?pid=234206#p234206

peteruithoven commented 10 years ago

I did some tests using 2 usb hubs and without: https://forum.openwrt.org/viewtopic.php?pid=235138#p235138

Good news: using our white usb hub almost eliminates the issue.

peteruithoven commented 10 years ago

Try: https://forum.openwrt.org/viewtopic.php?pid=235509#p235509