natewallis

natewallis

Hi.

I am working on a simple proof of concept. The business I work for has a series of products that have integrated screens which are driven by Android boxes. The android boxes are running this board:

I am able to enable USB debugging on this board and I have it connected to Android Studio on windows (OSX doesn’t connect properly via USB). The board is running Jellybean 4.2.2 and I am connecting to my phoenix websocket server using the following library:

https://github.com/eoinsha/JavaPhoenixChannels

For my proof of concept I am doing a simple task of sending messages from the server to my client boxes. Basically, I click a button on the webpage to change which video is playing on my clients. The clients receive the message and display the video… pretty simple.. And it works, kinda. :slight_smile:

Bear with me, I am trying hard not to make this sound like an Android programming question!

Testing on my Google Pixel, it worked fine (its running Android 8.X). However when connecting to the Tismart board, it seems to stop responding to messages from the server and also loses the ability to send independent messages back to the server. In my android application, I added a button that when clicked, sends a message back to the server - which the server does nothing with other than displaying a message using IO.puts. I added that button for debugging purposes to see if it was at a specific time that it would stop sending messages.

I am also catching any exceptions I can in Android and displaying them on the screen, but there seems to be a few that suggest that the connection was “reset by peer”…

Is there a callback or some other part of the ecosystem that I can hook into to determine what is happening with my connections? Unfortunately, I can’t easily do that on the client as they are running Android 4.2.2 and that doesn’t support profiling using the Android studio tools.

BTW the other technique I have tried is to send a ping message from the server to the clients and then have the clients respond to that message. My theory was that if the connections were timing out then this would help keep them alive… I was doing this every 20 seconds..

Showing Posts 9 to 1

natewallis

natewallis OP

Yep, Android 4.2.2 is the latest I can have running on that board. I still haven’t finished learning elixir let alone writing a custom build of Android! I will just work within the constraints I have. Wired is currently working fine, I will find some expertise as to why wireless might not be working so well on my board.

natewallis

natewallis OP

Ok… I don’t think its a simple as updating as I think the board manufacturer releases custom Android builds… I have tried to get in contact with them to see what the latest version is that they will support.

axelson

axelson

Scenic Core Team

We’re developing a consumer mobile app so we support all sorts of mostly modern versions of Android.

Android 4.2.2 is quite old at this point and is no longer receiving patches: Android version history - Wikipedia

If possible maybe you should try updating the version of Android that is running.

natewallis

natewallis OP

I just installed wireshark and noticed that my Android application was sending the heartbeat over and over… so I just tested on a wired connection and all is working fine… I wonder if Android 4.2.2 has particular issues regarding wifi communications. My application isn’t doing anything advanced with the radios… in fact it is doing nothing. Other than the most basic PhoenixJavaChannels demo..

natewallis

natewallis OP

Ok, good to know. Do you know what version of Android they are running? Other experts I have contacted suggested that early versions of Android had linux issues around the network communications where it would be a bit constipated when sending and receiving data on the network. But I don’t have enough knowledge about Android to confirm this.

axelson

axelson

Scenic Core Team

I know the Android developer at my company has been having some issues with the Android Phoenix Channels and there are numerous open issues, including support for v2 of the wire protocol: Please support V2 of wire channel wire protocol (introduced in Phoenix 1.3) · Issue #56 · eoinsha/JavaPhoenixChannels · GitHub

With that said we are successfully using the library in production for over a year now.

natewallis

natewallis OP

No, its not the simulator… i am running on the hardware I mentioned in my first post. Its a chinese android board.

I have since tried sending a heartbeat to the server as I thought that maybe the library I am using doesn’t do that. So that is my next port of call to make sure that they are working properly.

mihai-ciupina

mihai-ciupina

Are you running on Android simulator? I think it cannot reach the local server.

natewallis

natewallis OP

BTW, all of the above issues were observed when testing locally. The server and client are running on the same network with no firewalls (that I know of) in between.. There are definitely none on my computer, but I can’t be certain that the Android box has none. Although I wouldn’t expect it has one that is interferring with the connection as my system works for a short period of time (as described above) before becoming unresponsive.

Another observation I have made is that while my original theorising made it sound like the client was being disconnected from the server (although I have seen a connection reset by peer error), it seems more like the payloads are being held up in a queue of some sort / limited by something. When it seems that the client is no longer responsive I click the button on the screen of my client which sends a message to the server. One click, nothing happened on the server… So I click repeatedly… still nothing… until about 10 seconds later when a flood of debugging messages appear on the server saying that the button was clicked on the client. Again, both devices are running on the same network and pinging each machine on the command line returns times less that 10ms..

Any ideas of where I could look to make this respond reliably?

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews