Giter VIP home page Giter VIP logo

Comments (26)

agrossmann09 avatar agrossmann09 commented on June 23, 2024

Note: I can build and implement norm on both my raspberry Pi and mac book pro. I want to test communication between all three devices.

from norm.

bebopagogo avatar bebopagogo commented on June 23, 2024

Hi @agrossmann09 - Thanks for pointing this out. Somehow the Android files didn't get put on to GitHub from our SVN repository. I think it was because I had a .gitignore for "lib" directories which happens to be the name of the directory with the Android NORM library build files that were missing. I did a test build with the old-ish Android Studio install (3.1.1) I have and it built successfully. Note only the NORM library is built. I should add some of the command-line examples as build options for testing purposes. Let me know if this resolves your issues.

from norm.

agrossmann09 avatar agrossmann09 commented on June 23, 2024

Hi, thank you for the quick response. I am testing out the new code now but I am still encountering an issue. I have NDK installed through the sdk manager and configured local.properties to define ndk.dir to point to my new ndk directory. However I am receiving this message:

Configure project :lib
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to /Users/Owner/Library/Android/sdk/ndk/23.0.7599858.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':lib'.

java.lang.NullPointerException (no error message)

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

from norm.

agrossmann09 avatar agrossmann09 commented on June 23, 2024

I also don't know if I should create a separate issue for this, but when I have a sender and receiver active and leave the session with my sender and rejoin. The receiver won't process any new connection from the senders session id. The RFC states that it should drop any previous state it has with the old session and treat the instance as a new one.

from norm.

bebopagogo avatar bebopagogo commented on June 23, 2024

from norm.

agrossmann09 avatar agrossmann09 commented on June 23, 2024

I hope I understand this correctly by the receiver reserves resources for each session it keeps track of. Lets say for scalability reasons we create and disconnect many sessions. Will resource constraints be a problem if we continually leave the session. I am thinking of a situation where we might not want the session to be continually running. I know we can set the TTL on the recv end but was just curious.

from norm.

bebopagogo avatar bebopagogo commented on June 23, 2024

With regards to you Android Studio question, I don't use it often enough to have an offhand answer to your question. From the error message you are getting, perhaps you need to also install a target platform component (like x86 or ARM, etc processor) for it to build an appropriate library?

from norm.

bebopagogo avatar bebopagogo commented on June 23, 2024

It doesn't keep history on the sender instanceId so in actuality as soon as it sees a new instanceId, it drops all state for the prior instance of a given sender NormNodeId. So, if a another new instanceId shows up that is different from the current one, even if it is one that was used previously, it will have the same effect.

from norm.

agrossmann09 avatar agrossmann09 commented on June 23, 2024

Again thank you for explaining the functionality to me. So if I understand correctly lets say I have comms between a sender and recv. If halfway through those comms if another sender with a different instanceID sends a message, then the previous comms with the original sender would be dropped?

from norm.

bebopagogo avatar bebopagogo commented on June 23, 2024

That's correct. That also means if the previous transmission has not successfully completed, it will be lost. If you want to ensure that does not happen, consider using the optional ACK mechanism for receipt confirmation before the prior sender instance exits. The "example" applications (normMsgr, normStreamer, normCast) illustrate this.

from norm.

agrossmann09 avatar agrossmann09 commented on June 23, 2024

I think what attracted me to norm was the lack of receipt confirmation. Is there a way to configure norm so that if another sender is queuing a data object, not to send that object until the floor is clear so that it doesn't interrupt another sender?

from norm.

agrossmann09 avatar agrossmann09 commented on June 23, 2024

I was also able to get around my android problem and then hit another. I am now using ndk version 20.0.5594570, but encountered this error: Invalid revision: 3.18.1-g262b90

from norm.

agrossmann09 avatar agrossmann09 commented on June 23, 2024

Okay I was able to solve my issue with the ndk. I needed to upgrade my android version to 27 and in the CMakeLists.txt change it to android 27. Before that I also needed to downgrade my cmake version. This is just a work around and not a solution.

from norm.

agrossmann09 avatar agrossmann09 commented on June 23, 2024

Once I have the binaries built, what is the usage? Can I develop my own app with the libraries built and if so which ones do I have to implement in my custom gradle file?

from norm.

bebopagogo avatar bebopagogo commented on June 23, 2024

I think what attracted me to norm was the lack of receipt confirmation. Is there a way to configure norm so that if another sender is queuing a data object, not to send that object until the floor is clear so that it doesn't interrupt another sender?

NORM does not have a built-in floor control protocol. One could use the NORM API to do something since there are notifications issued when object reception starts/stops and a sort of carrier-sense multiple access floor control protocol could written at the application layer using those cues (e.g. with random backoff timeouts some multiple of GRTT to reduce floor access "collisions" and perhaps use lowest or highest NormNodeId to give priority access on a "collision" ... although that approach would bias access ... I suppose a rule to give precedence to the node that has gone longest withoout floor access longest and then break a tie with the low (or high) node id could be used .... It would be fun to implement ;-)

from norm.

bebopagogo avatar bebopagogo commented on June 23, 2024

Once I have the binaries built, what is the usage? Can I develop my own app with the libraries built and if so which ones do I have to implement in my custom gradle file?

Yes - once you have built the NORM libraries you can link those to your own NDK code. I think we have also build and used the NORM JNI binding for some Android apps in the past. Personally, I have been using a cross-platform C++ GUI framework where specific submodules can be specified via source file and I just include the NORM and Protolib source files as submodules of the project (That particular framework then generates the Android Studio projects for me so I haven't delved much myself into the details of creating proper Android Studio projects from scratch). For a command-line NDK service or application on Android, you can just do your own NDK project. The MGEN project I also have here on Github builds the "mgen" command-line executable as an Android executable.

from norm.

bebopagogo avatar bebopagogo commented on June 23, 2024

(BTW - this line of discussion might be a better fit to the NORM "Discussions" area rather than under an "Issue")

from norm.

agrossmann09 avatar agrossmann09 commented on June 23, 2024

Okay, I will move my discussion on android to the "Discussions." Thank you for answering my other question.

from norm.

agrossmann09 avatar agrossmann09 commented on June 23, 2024

Or were you referring to my 'floor' question should be moved to "Discussions"? I am still having trouble with Android. I have a .aar file now and was able to import it, but the only class available is BuildConfig.

from norm.

bebopagogo avatar bebopagogo commented on June 23, 2024

Yes - I was thinking more about the "floor control" protocol question if it become more of a discussion thread. The Android issues we keep here if you want although now that we have resolved the Android build of the norm library, your questions are more in the vein of Android development issues. I have limited experience with that and some of those question may be more quickly/better addressed in an Android development forum. I am happy to help as I can and certainly will address anything from the NORM code standpoint that I can.

The current gradle files build the NDK NORM library as a static library that can be linked against from other NDK code. The JNI code is also compiled and a shared library is built "libmil_navy_nrl_norm.so" that would be used with a JAR file so that the Java API binding could be used for an Android Java application. I don't think the current gradle config builds the JAR file. The other build system (e.g., waf) do provide means to build the JAR file. I need to check with someone on my team who has used the NORM Java API on Android on how they built the JAR, etc. It may be the case that was done with the older Android build approach prior to Android Studio use of gradle.

from norm.

agrossmann09 avatar agrossmann09 commented on June 23, 2024

Okay. I assumed gradle might be the easiest form of building the libraries I needed since the method in the makefile uses outdated tools. I am more than happy to walk through that method if it produces the jar files needed, I am just not familiar with those build tools and how to get them to work on a newer system.

from norm.

bebopagogo avatar bebopagogo commented on June 23, 2024

I'm in work meetings, etc but I'm doing a little web searching to see what would need to be added to the gradle file to also build the JAR file and a .aar if that what is needed to better support Android NORM app development. It looks like this may be possible and if you determine how to do that I would be happy to accept a pull request or incorporate that into the gradle configuration files.

from norm.

agrossmann09 avatar agrossmann09 commented on June 23, 2024

Okay I will do some research as well and see if I can get it to build the jar. When you get time to answer as I know you are working, will norm perform packet fragmentation if my bytebuffer or file is over 1500 bytes? It seems protolib crashes when sending over 1440 bytes.

from norm.

bebopagogo avatar bebopagogo commented on June 23, 2024

Yes - NORM fragments data into the configured "segment size" that is set as part of the NormStartSender() API.

Which Protolib class/method are you referring to? There are some operating system limits and defaults that can come into play. For example, UDP datagrams are often limited to an 8192 byte max. I'm not sure where the 1440 max may come from. Some of my code examples may not be as rigorous as they should be and may exhibit such issues, but the ProtoSocket APIs should work (or not) with crash issues. If you do find a bug like that, let me know

from norm.

agrossmann09 avatar agrossmann09 commented on June 23, 2024

I'm sorry to return back to this thread but I was able to get everything built and used in an Android application. It involved building the ant jar and bundling into the .aar. Then the app just needs to run a couple of tasks, which I detail in the README, and everything works. I have a branch created but I don't think I can push. Please let me know if you would like me to continue with the push/merge and review.

from norm.

bebopagogo avatar bebopagogo commented on June 23, 2024

I accepted the pull request. Feel free to close this issue if you are satisfied.

from norm.

Related Issues (20)

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.