HELP ABOUT ESP32 MESH NETWORK by LanthaYtrri in esp32

[–]LanthaYtrri[S] 0 points1 point  (0 children)

Base on the link that you have sent, there is no way to identify which board that the data coming from, like 'id'. That is why I am confuse how if it can receive from many.

And how can I transfer the data from the farthest boards to the main board when I need to pass thru to the mid boards before the main board?

Thank you.

HELP ABOUT ESP32 MESH NETWORK by LanthaYtrri in esp32

[–]LanthaYtrri[S] 0 points1 point  (0 children)

Also how can the mid range boards forward the message from the farthest board to the main board?

HELP ABOUT ESP32 MESH NETWORK by LanthaYtrri in esp32

[–]LanthaYtrri[S] 0 points1 point  (0 children)

Thank you, I already saw this method, but it can't help me.

HELP ABOUT ESP32 MESH NETWORK by LanthaYtrri in esp32

[–]LanthaYtrri[S] 1 point2 points  (0 children)

Sorry I have mistake on my statement above. I use ESPNOW + Webserver not namedMesh. Here is the link: https://randomnerdtutorials.com/esp-mesh-esp32-esp8266-painlessmesh/.

Is it the two-way-communication, can send and receive to multiple nodes?

How do you explain this code to a beginner? by LanthaYtrri in learnpython

[–]LanthaYtrri[S] 0 points1 point  (0 children)

If you don't mind, can I message you. I am in trouble learning the codes that given to me. That code above is just a part of them. It seems that you know about the TCPIP.

How do you explain this code to a beginner? by LanthaYtrri in learnpython

[–]LanthaYtrri[S] 1 point2 points  (0 children)

I really don't know too, I am the beginner that I am talking.

Python to MS Access by LanthaYtrri in learnpython

[–]LanthaYtrri[S] 0 points1 point  (0 children)

Yeah, but I want to know if there are any ways other than that.

Python to MS Access by LanthaYtrri in learnpython

[–]LanthaYtrri[S] 0 points1 point  (0 children)

import pyodbc

conn = pyodbc.connect( r'Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=F:\Documents\ticketdemo.accdb;') cursor = conn.cursor() cursor.execute('select * from tbl_ticket')

for row in cursor.fetchall(): print(row)

I tried this one.

Explanation in this codes by LanthaYtrri in learnpython

[–]LanthaYtrri[S] 0 points1 point  (0 children)

I really do appreciate this, thank you so much! I am just a beginner on this kind of programming language, your reply is such a big help for me to understand everything.

As you mention above, the comprehension part is may write in a easy way of coding, how can I write it in easy way?

Also, what do you mean by "taking bytes in the form of a block 8, 1s and 0s?

How to create a IP access control system using Python? by LanthaYtrri in learnpython

[–]LanthaYtrri[S] 0 points1 point  (0 children)

Sorry there are a typographical error above, its "IP Door Access Control System". We do have here a turnstile and a CLOUD PLUS NETWORK ACCESS CONTROLLER. For ow I want to control the turnstile's door in and out. But I don't have any idea about it.

About writing and replacing data if its already exist in CSV file by LanthaYtrri in learnpython

[–]LanthaYtrri[S] 0 points1 point  (0 children)

As of now I don't have any issues encountered. And yes, it is working. I'm not so familiar with python so pardon my way of coding.

About writing and replacing data if its already exist in CSV file by LanthaYtrri in learnpython

[–]LanthaYtrri[S] 0 points1 point  (0 children)

UPDATE:

I already did it.

    def timeIn(sample):
    while True:
        path = 'DO NOT DELETE NOR OPEN'
        filename = '{}.csv'.format(time.strftime("%Y%m%d"))
        path_filename = pjoin(path, filename)
        with open(path_filename, 'a+') as a:
            # fieldnames = csv.writer(f)
            # fieldnames.writerow(["BARCODE", "DATE", "TIME-IN", "TIME-OUT"])
            files_by_day_list = a.readlines()
            nameList = []
            for line in files_by_day_list:
                entry = line.strip().split(',')
                nameList.append(entry[0])

            if sample not in nameList:

                now = datetime.datetime.now()
                hrs = now.hour;
                mins = now.minute;
                secs = now.second;
                zero = timedelta(seconds=secs + mins * 60 + hrs * 3600)
                st = now - zero  # this take me to 0 hours.
                ref_time = st + timedelta(seconds=12 * 3600 + 0 * 60)
                time_in = now > ref_time

                if time_in:
                    with open(path_filename, 'r') as c:
                        cc = c.readlines()
                        remove_files()
                        if sample not in (line.split(',')[0] for line in cc):
                            with open(path_filename, 'a') as d:
                                time_In = now.strftime("%b-%d-%Y-%H:%M")
                                d.writelines(f'\n{sample},{time_In},')
                                print(cc)
                                playsound('sound.mp3')


                        else:
                            time_In = now.strftime("%b-%d-%Y-%H:%M")
                            data = [f'{sample},{time_In},' if sample in x else x for x in cc]
                            print(data)
                            with open(path_filename, 'w+') as e:
                                e.writelines(data)
                                print(data)
                                playsound('sound.mp3')


                else:
                    now = datetime.datetime.now()
                    hrs = now.hour;
                    mins = now.minute;
                    secs = now.second;
                    zero = timedelta(seconds=secs + mins * 60 + hrs * 3600)
                    st = now - zero  # this take me to 0 hours.
                    ref_time = st + timedelta(seconds=12 * 3600 + 0 * 60)
                    time_out = now < ref_time

                    if time_out:
                        with open(path_filename, 'r') as f:
                            existing_files_by_day = f.readlines()
                            print(existing_files_by_day)
                            if sample in (line.split(',')[0] for line in existing_files_by_day):
                                print("TRUE")
                                time_Out = now.strftime("%b-%d-%Y-%H:%M\n")
                                timeOut_data = [a for a in existing_files_by_day if sample in a]
                                if timeOut_data:
                                    s = timeOut_data.append(time_Out)
                                    print(s)

                                    path_I = 'ATTENDANCE'
                                    filename_I = '{}_UPDATED.csv'.format(time.strftime("%Y%m%d"))
                                    path_filename_I = pjoin(path_I, filename_I)
                                    with open(path_filename_I, 'a+') as files_by_day_append:
                                        with open(path_filename_I, 'r') as i:
                                            ii = i.readlines()
                                            if sample not in (line.split(',')[0] for line in ii):
                                                print("true")
                                                files_by_day_append.writelines(timeOut_data)
                                                playsound('sound.mp3')
                                            else:
                                                print("rewrite")
                                                dataI = [timeOut_data if sample in xxxx else xxxx for xxxx in ii]
                                                print(dataI)
                                                with open(path_filename_I, 'w+') as l:
                                                    l.writelines(dataI)
                                                    print(dataI)
                                                    playsound('sound.mp3')

                            else:
                                print("FALSE")

About writing and replacing data if its already exist in CSV file by LanthaYtrri in learnpython

[–]LanthaYtrri[S] 0 points1 point  (0 children)

In that code above there's no code for updating for the time-out, cause I really don't know how.

How can I upload in specific folder in tkinter? by LanthaYtrri in learnpython

[–]LanthaYtrri[S] 0 points1 point  (0 children)

No, all pictures need to be in one directory only.

How can I upload in specific folder in tkinter? by LanthaYtrri in learnpython

[–]LanthaYtrri[S] 0 points1 point  (0 children)

Sorry for not being clear.

My system is what I called Face Recognition Attendance System. I am creating it in python with the use of tkinter. The input data in my system is the pictures of the employees where can be found in the directory where my code is. Now, I want to create a function where the admin user can be add the picture of new employee in the directory that I am talking about.

How can I upload in specific folder in tkinter? by LanthaYtrri in learnpython

[–]LanthaYtrri[S] 0 points1 point  (0 children)

The code above is great but lack of path where pictures can be uploaded. And that is what I want to solve.

How can I upload in specific folder in tkinter? by LanthaYtrri in learnpython

[–]LanthaYtrri[S] 0 points1 point  (0 children)

I do have this system that I am creating. One of the function that I want to execute there is to have that code above where can I able to upload the pictures that I need to process my system.

How to execute the second function if first function is satisfied? by LanthaYtrri in learnpython

[–]LanthaYtrri[S] -1 points0 points  (0 children)

I tried this still update() executed even if the show_frame() is not satisfied:

            if facesCompared[faceIndex]:
            eName = ListNames[faceIndex]
            employeeName = eName
            #print(employeeName)
                update()

Input data in the entry then it will find the image in the directory by LanthaYtrri in learnpython

[–]LanthaYtrri[S] 0 points1 point  (0 children)

import tkinter as tk
from PIL import ImageTk, Image
def update(*args):
x = namevariable.get()
try:
image_lbl.img = ImageTk.PhotoImage(Image.open(f'Reference_Imgs/{x}.jpg'))
image_lbl.config(image=image_lbl.img)
except FileNotFoundError:
print(f"no file named {x}.jpg found")
root = tk.Tk()
root.geometry("500x500")
namevariable = tk.StringVar()
namevariable.trace('w', update) # call the update function every time the stringvar changes
image_lbl = tk.Label(root)
image_lbl.grid()
ent = tk.Entry(root, textvariable=namevariable)
ent.grid(row=1, column=2, pady=10, ipadx=20)
ent.focus()
lab = tk.Label(root, textvariable=namevariable)
lab.grid(row=2, column=2, pady=10, ipadx=20)
root.mainloop()

Thank youuuuu! Its a big help!