Esp8266 NFC multi door lock system

New prototype boards
https://drive.google.com/file/d/1U14EYc_4Kqo7vlegBX2X0XYQStzabn8C/view?usp=sharing

3 Likes

Doing 4 more doors at my hangar in California. I will test it and I hope upgrade it when the new platform is available.

:rofl::rofl::rofl:

3 Likes

qrc for project

1 Like

Finally getting around to using my own server. I had some problems getting the hardware to connect. In the end I found that the OTA update did not replace the wifi information so I had to use a cable. Too bad for the hardware that was covered in resin I guess it will never be able to connect to the private server.

After I discovered this problem I added a way to update the server name/ip from the configuration portal. I should also make it go to the portal if the hardware does not connect to the blynk server but I am still thinking about how to do that and keep the reader active so that the door can be opened.

I have not pushed the code up to github yet. I will test it for a bit first and see if there are other updates I want to make.

Updating the code and hardware for 2.0 I have it compiling but have not created the new hardware.
Created the templates for WEB and Mobile.
Removed code that did the provisioning. I expect to use Edgent.

I still have a few problems that I need to resolve but it should work.

The biggest changes are in the provisioning and communication between the locks and the programmer/master lock I may remove the need for the master lock and try to do a master data store only.

2 Likes

It is taking a bit more time than I expected. I need to learn more about 2.0

Now that PeterKnight has got me through the http api I am beginning to try to convert from bridge data to API data in this project. I am going to make some nice upgrades as I do it so that it will feel worth the time.

Hi Mike,
You seem to be having a number of different conversations in different topics about individual elements of your modified system.
I’m still not convinced that your apparent idea of sending an auth token from one device to another is going to work in practice, but you’ve not elaborated on that.

You’ve also started a conversation in an Automations topic about time input, but from what you said, it would probably be much neater to use one or more Time Input widgets to enter the time schedule (two widgets would be needed if different access times were needed on weekends compared to mid week for example).

Maybe it would be better to use this topic to give an overview of the logic processes in your new system, and and the functionality that you want it to contain. That way, I think you’re going to get better feedback when people can see your “big picture” and you might avoid going down some rabbit holes in the process.

Pete.

I used this in the previous iteration on the old blynk to allow the scanner to authorize cards for other locks. By doing that I don’t need to go to each lock to authorize card keys.

I am exploring ways to store data on a dummy device (with no hardware). If you have any ideas I am excited to hear them.

You’d need to provide a much more comprehensive explanation and overview for me to be able to do that.

Edited to add…

Things get much more complicated when you do dynamic provisioning in Blynk IoT, as when you provision a device it will be dynamically provided with an Auth token. Re-provisioning a device will give it a new dynamic token.
I fear that you could have two unknown tokens - one on the sending device and the other on the receiving device.
The sender can’t send to the receiver because it doesn’t know it’s auth token. The receiver can’t tell the sender it’s auth token, because it doesn’t know the sender’s auth token to push that data to.

I’m assuming that this wasn’t an issue before, as you weren’t using dynamic provisioning in Legacy?

Pete.

I need to be able to have a list of devices in the app.

In the old blynk I used the device selector to change the target device/lock. I am having a hard time trying to replace the functionality of the old system in the current blynkio.

I also used the terminal as a log of when any card was scanned and the action that occurred.

I used the time input to set availability of the lock based on used flags.

Much of that is not currently supported so I am evaluating ways to accomplish these things using the current environment.

It may be that it is just too much to do. (:frowning:

The closest you have to that in Blynk IoT is the “Device Tiles” on the front screen.
Otherwise, it’s a case of using tabs on one device and sending all of the data to there from each device, with one tab per device.

You could use Events for this.

That’s still available.

Not quite sure what you mean with this.

As I’m sure you 're expecting me to say, life wold be easier if you used Node-Red as your single interface with Blynk, and used MQTT messaging to communicate with your devices. My RFID access stem works like this, but is much simper than yours although it certainly has the potential to more sophisticated.

Pete.

Pete, I am trying to work out a way to get all the device ids for my locks.
It looks like this data type creates a menu with all the device ids in the metadata.
Screenshot(13)

Can I just copy the data to a Menu?

BLYNK_CONNECTED() {
  rtc.begin();                              // Synchronize time on connection
  //  bridge_master.setAuthToken(reader_token); // Token of reader
// get the token from the metadata
  Blynk.sendInternal("meta", "get", "AuthToken");
  Blynk.sendInternal("meta", "get", "List of doors");
}

BLYNK_WRITE(InternalPinMETA) {
    String field = param[0].asStr();
    if (field == "AuthToken") {
       reader_token = param[1].asStr();
        // Do something with Metadata value
    } else if (field == "List of doors") {
        // Populate the list of devices in the menu with Metadata values
    }
}

Hi Mike,
I’m sorry, I don’t really understand what you’re asking, or what you’re referring to when you say…

Can you elaborate?

Pete.

When I added the data type device reference to the meta data it asked for the templates.

After I added the templates it created a drop down menu with all the devices. In the meta data of the devices that used that template.

I am hoping to be able to use that data to populate a menu in my device interface to allow for device selection.

I don’t know what this meta data looks like. Is there a place that documents the meta data in better detail?

The documentation is here, but there appear to be some errors - or maybe it’s bugs/omissions in the implementation.
https://docs.blynk.io/en/blynk.edgent/api/metadata

You should probably read this…

Pete.

1 Like

I did read and work with the meta data. I guess that many parts of it are not well documented. For instance I saw nothing about the device reference data type.

In practice I can create the type and set a reference device from the console but I would like to be able to look at the available devices during run time in a device.

All of this would be unnecessary if bridge data were implemented.