David Schofield - 2013-07-11

Julie, will this work with wired ethernet under Android?
I have a both a Toshiba Thrive (4.0.3) and Curtis Klu MID704 (4.1.1). I'm using a Belkin USB-to-Ethernet RJ-45 interface. The Toshiba supports DHCP, the Curtis ($79) supports static IP on Eth0!!!
I can successfully ping the modbus slave (a WAGO 750-352 fieldbus device) but when I connect, using...

        //2. Open the Modbus/TCP connection
        try {
            Log.e("TCP","con = new TCPMasterConnection(addr)");
            con = new TCPMasterConnection(addr);
            Log.e("TCP","con.setPort(port)");
            con.setPort(port);
            Log.e("TCP","con.connect()");
            con.connect();
        } catch (Exception ex) {
            ex.printStackTrace();
            showToast("Error: " + ex.getMessage() + 
                    " while connecting to Modbus/TCP port." , Toast.LENGTH_SHORT);
        }

I'm getting an error at the statement con.connect(); but the getMessage data is null. (edited for clarification.-d)

My WiFi is turned off, and I'm thinking that instead of checking which interface to use (wlan0 vs. eth0) j2mod is defaulted to or forcing wlan0, the wifi interface.

Q. Can you or anyone else please confirm or shed light on this?
Q. Has anyone else ever gotten it to work on Android with a wired interface?
Q. Can anyone help me find where in the source code it gets the network connection(?) so that I can tell it to use Eth0?

I don't mind the leading edge, but this is now the bleeding edge.

Thanks!
David Schofield
Hotspot Office, LLC
Pittsburgh, PA
412.726.1147

 

Last edit: David Schofield 2013-07-12