GUI-O Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    NFC function

    Scheduled Pinned Locked Moved
    Comments & Feedback
    2
    16
    977
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Sato
      last edited by

      Hi kl3m3n,

      Nowadays most smartphones have NFC.
      I leave here the new challenge, is there a way for Gui-O to use this feature?

      Regards

      K 1 Reply Last reply Reply Quote 0
      • K
        kl3m3n @Sato
        last edited by

        @sato GUI-O supports NFC, but this feature is currently disabled. I will enable it, but first I just need to think how to expose it to the user. Possibly through hardware components, similarly as RTC (real-time clock).

        Best regards,
        kl3m3n

        S 1 Reply Last reply Reply Quote 0
        • S
          Sato @kl3m3n
          last edited by

          Hi @kl3m3n,

          As most smartphones have the NFC Reader integrated, in my opinion it is to be able to read a Tag's ID and the Gui-O make that information available for the user to use in any way they need. In this case I don't think any hardware other than the Tag will be necessary.

          Best regards

          K 1 Reply Last reply Reply Quote 0
          • K
            kl3m3n @Sato
            last edited by

            @sato Thank you, I will add it to the list (with low priority).

            Best regards,
            kl3m3n

            S 1 Reply Last reply Reply Quote 0
            • S
              Sato @kl3m3n
              last edited by

              Hi @kl3m3n,

              Ok, i know you have priorities. In my opinion it's an excellent feature. It is a way to know if the connection was remote or local on the equipament, this makes a lot of difference during information management.

              Best regards

              K 1 Reply Last reply Reply Quote 0
              • K
                kl3m3n @Sato
                last edited by kl3m3n

                @sato NFC feature is implemented in v1.0.15. Please check the new developer manual.

                Best regards,
                kl3m3n

                S 3 Replies Last reply Reply Quote 0
                • S
                  Sato @kl3m3n
                  last edited by

                  Hi @kl3m3n,

                  Great. THANK YOU.

                  Soon i will buy a Tag to make tests and give feedback.

                  Best regards

                  1 Reply Last reply Reply Quote 0
                  • S
                    Sato @kl3m3n
                    last edited by Sato

                    Hi @kl3m3n,

                    Today received the Tags

                    mqttClient.publish(&In[0], "|NFC UID:nfc1 HID:nfc SEN:1\r\n");
                    Gui-O respond with @nfc1 -2

                    Make NFC on, it receive nothing

                    Tested with my both Samsung Phones

                    Attached the picture of the Tags

                    (https://i.imgur.com/67bKB15.jpg)

                    Regards

                    1 Reply Last reply Reply Quote 0
                    • S
                      Sato @kl3m3n
                      last edited by

                      Hi @kl3m3n,

                      Forgett to add the data of the Tags read with a NFC read App
                      Hope it can help

                      Best regards

                      D_NFC TagInfo.jpg C_NFC TagInfo.jpg B_NFC TagInfo.jpg A_NFC TagInfo.jpg

                      K 1 Reply Last reply Reply Quote 0
                      • K
                        kl3m3n @Sato
                        last edited by

                        @sato Did you write any record to the tag? You need to write at least one plain text record to the tag (GUI-O does not support writing tags). There are may apps able to write the NFC data. Did you consult the manual?

                        Best regards,
                        kl3m3n

                        1 Reply Last reply Reply Quote 0
                        • S
                          Sato
                          last edited by Sato

                          Hi kl3m3n,

                          Yes I read the Manual, but I must be doing maybe something wrong, because it doesn't work.

                          In the final part of making the graphical environment I put:
                          mqttClient.publish(&In[0], "|NFC UID:nfc1 HID:nfc SEN:1\r\n");

                          mqttClient.publish(&In[0], "|TON UID:ton1 HID:ton EDUR:3000\r\n");

                          Inside the void loop I have a Timer that periodically runs:

                          mqttClient.publish(&In[0], "@nfc1 SEN:1\r\n"); // wouldn't even need

                          mqttClient.publish(&In[0], "@ton1 1\r\n");
                          Serial.println("TON");

                          Always plays a short sound

                          I recorded the text "Hello Gui-O" in a Tag, with an App Tool for NFC. I can read that text even with the internal functionality of the phone, but on the serial port nothing appears.

                          void parseGuioMsg(const String &msg) {
                          Serial.println(msg); // @init usr:
                          variable msg is always empty

                          To make sure if there is something wrong with my code, I tried it with your example lamp code, but the effect is the same

                          Here I switch Off the NFC function on the Phone, on tap's on the lamp it shows on serial port.
                          GUI-O app is requesting LIGHT ON!
                          TON
                          SEN:1
                          @nfc1 -2 dev:OF24 R. Paris Nr.32 usr:
                          @light_on 1 dev:OF24 R. Paris Nr.32 usr:

                          GUI-O app is requesting LIGHT OFF!
                          @nfc1 -2 dev:OF24 R. Paris Nr.32 usr:
                          @light_off 1 dev:OF24 R. Paris Nr.32 usr:

                          Perhaps you can see what i make wrong
                          Thank You

                          Best regards

                          K 1 Reply Last reply Reply Quote 0
                          • K
                            kl3m3n @Sato
                            last edited by

                            @sato Hello!

                            Regarding the TON component - this component plays the tones builtin the Android device. Their length is predetermined. If you check out the manual, it says:

                            For TONT -> Tone type number. For reference see:
                            https://developer.android.com/reference/android/media/ToneGenerator
                            

                            and

                            For EDUR -> Duration of tone in msec. Ignored if
                            tone duration is shorter.
                            Maximum duration limited to 5000
                            msec.
                            

                            Regarding the NFC - if "-2" is returned, it means that NFC is available, but not enabled (see the manual).

                            You don't need to repeat the messages to enable NFC scanning. Try sending just one message:

                            Enable NFC detection:
                            |NFC UID:nfc1 HID:nfc SEN:1
                            
                            Disable NFC detection:
                            @nfc1 SEN:0
                            

                            Do you use Android 12? Do you have latest app version installed (v1.0.16)? There was a minor fix for Android 12 in this version release.

                            Best regards.
                            kl3m3n

                            S 1 Reply Last reply Reply Quote 0
                            • S
                              Sato @kl3m3n
                              last edited by Sato

                              Hi kl3m3n,

                              Thanks.
                              With the short sound it's no problem, but the NFC still doesn't work here.
                              As I informed, the only reaction from Gui-O is @nfc1 -2, I just switch off the NFC on the Phone to see if Gui-O would react.

                              I don't think I'm doing anything wrong, but if you want I'll send your code example to see if it works.

                              Yes, i update to the new version

                              Best regards

                              K 1 Reply Last reply Reply Quote 0
                              • K
                                kl3m3n @Sato
                                last edited by

                                @sato There was a mistake on my side. There were some changes in Android 12 that were not handled correctly by GUI-O app. Now it should work - I have tested it on Android 12 and Android 11.

                                The version that has the fix is v1.0.17.

                                I would appreciate the feedback.

                                Thank you.

                                Best regards,
                                kl3m3n

                                S 2 Replies Last reply Reply Quote 0
                                • S
                                  Sato @kl3m3n
                                  last edited by Sato

                                  Hi kl3m3n,

                                  Ok, Thank You
                                  At this moment the new version is not yet available on Google Play.

                                  Regards

                                  1 Reply Last reply Reply Quote 0
                                  • S
                                    Sato @kl3m3n
                                    last edited by Sato

                                    Hi kl3m3n,

                                    Well done, congrats!

                                    So, now will see to implement it in my programm

                                    THANK YOU

                                    Best regards

                                    1 Reply Last reply Reply Quote 0
                                    • First post
                                      Last post