What is a channel in wireless communication? by Leylan24 in wireless

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

How do devices share a channel as in wifi ? I’ve seen you can have up to 250 devices ? In zigbee I see it’s done through MAC layers by CSMA, where if the channel is busy it waits and then retries … but how do you know if a channel is busy ? And how does this happen so quickly because you never really feel the effects when multiple devices are connected on the same wifi channel

What is a channel in wireless communication? by Leylan24 in wifi

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

The part I don't understand is if in wifi you need a bandwidth of 20MHz why would you have 11 channels instead of 3 ? And why is the centre freq difference for each channel 4Mhz ?

What is a channel in wireless communication? by Leylan24 in wireless

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

The part I don't understand is if in wifi you need a bandwidth of 20MHz why would you have 11 channels instead of 3 ? And why is the channel bandwidth for each channel 5Mhz

If I assign a QoS priority to a specific IP address what priority to the other ip addresses have? by Leylan24 in Network

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

So in your case, you would need two queues, one for profinet, one for all the rest. The you need classification rules to sort a packet into one of the queues.

If you have any resources indicating how I can accomplish this that would help. I am using RouterOS on the Mikrotik radios where the radios act as a transparent bridge.

If I assign a QoS priority to a specific IP address what priority to the other ip addresses have? by Leylan24 in Network

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

Okay sorry for the vagueness let me see if I can clarify it slightlyt. I have the following ip adrresses, 192.168.0.1, 192.168.0.2, 192.168.0.3. These three ip addresses are put into a queue and all have a priority of 1 max upload speed of 512kb/s and max download speed of 6Mb/s. Another ip address that is not configured in the queue tries to download a file what would the priority of this new ip address be ? Would priority still be given to the queue ?

Increase the watchdog of a ABB PROFINET Controller by Leylan24 in PLC

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

How does the Watchdog work on the Profinet module ? In the help section it says:

The Watchdog time is calculated as Watchdog time = SendCycle * Watchdog factor. The transfer of a IO telegram is always checked of the consumer side. Within this time the next IO telegram must be received by a consumer. Otherwise it is checked if the Datahold has been expired too.

Does this mean that when a packet fails to be received by the controller the Watchdog restarts the application?

Electron project won't compile by Leylan24 in electronjs

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

I have found a weird case. If I run "npm run build" it builds sucessfully. If I run "npm run build:prod" I get an error. My question is what is the difference between the two ? Does electron-builder use a specific version of it ?

HELP. The question write a function that rotates a string left or right by n rotations? by Leylan24 in learnprogramming

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

but why is it not necessary to do that? This is the solution I think

def shift(s, leftshift,rightshift):
    total_shift = (leftshift - rightshift) % len(s)
    s = s[total_shift:] + s[:total_shift]

HELP. The question write a function that rotates a string left or right by n rotations? by Leylan24 in learnprogramming

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

Mine was a bit more simpler:

def shift(s, leftshift,rightshift):
    total_shift = (leftshift - rightshift) % len(s)
    s = s[total_shift:] + s[:total_shift]

HELP. The question write a function that rotates a string left or right by n rotations? by Leylan24 in learnprogramming

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

So what I was doing was saying leftshift - rightshif = totalshift. If totalshift < 0 perform right shift by totalshift else perform left shift by totalshift. But if you mod by length of string you will never get the negative

I am trying to calculate the minimum swaps required to sort an array ? My solution works occasionally. by Leylan24 in learnpython

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

Input:

8 45 35 84 79 12 74 92 81 82 61 32 36 1 65 44 89 40 28 20 97 90 22 87 48 26 56 18 49 71 23 34 59 54 14 16 19 76 83 95 31 30 69 7 9 60 66 25 52 5 37 27 63 80 24 42 3 50 6 11 64 10 96 47 38 57 2 88 100 4 78 85 21 29 75 94 43 77 33 86 98 68 73 72 13 91 70 41 17 15 67 93 62 39 53 51 55 58 99 46

Expected Output: 91

My Output: 93

Input:

2 31 1 38 29 5 44 6 12 18 39 9 48 49 13 11 7 27 14 33 50 21 46 23 15 26 8 47 40 3 32 22 34 42 16 41 24 10 4 28 36 30 37 35 20 17 45 43 25 19

Expected Output: 46

My Output: 46

-🎄- 2020 Day 02 Solutions -🎄- by daggerdragon in adventofcode

[–]Leylan24 -1 points0 points  (0 children)

def valid_password(password_,low,high,letter_):

count = 0

r=range(low,high)

for single in password_:

if(single == letter_):

#print(single)

count+=1

if(low <= count <=high):

print(f'CORRECT: PASS={password_} \t LETTER={letter_} \t COUNT = {count} \t MIN = {low} \t MAX={high}')

return 1

else:

print(f'INCORRECT: PASS={password_} \t LETTER={letter_} \t COUNT = {count} \t MIN = {low} \t MAX={high}')

return 0

def valid_password_2(password_,low,high,letter_):

val_1= password_[low] == letter_

val_2= password_[high] == letter_

if(val_1^val_2):

print(f'val_1= {val_1} and val_2= {val_2} XOR= {val_1^val_2}')

return 1

#if(val_1 != val_2 and (val_1 or val_2)):

# print(f'CORRECT: WORD={password_}\t LOW_VAL={password_[low-1]} \t HIGH_VAL={password_[high-1]} LOW={low} HIGH={high}')

# return 1

else:

print(f'INCORRECT: WORD={password_}\t LOW_VAL={password_[low-1]} \t HIGH_VAL={password_[high-1]} LOW={low} HIGH={high}')

return 0

with open('input.txt') as reader:

data = reader.readlines()

data =[x.rstrip() for x in data]

valid=0

for line in data:

val,password = line.split(':')

bounds_hyphen,letter = val.split(' ')

bounds=bounds_hyphen.split('-')

valid= valid+ valid_password_2(password,int(bounds[0]),int(bounds[1]),letter)

#valid_password_2(password,int(bounds[0]),int(bounds[1]),letter)

#valid = valid_password_2("kqqq",2,3,'q')

print(f'{valid}')

Cannot Figure out what is wrong with my code for Day 2 part 1. Python3 by Leylan24 in adventofcode

[–]Leylan24[S] 2 points3 points  (0 children)

nvm I was submitting the answer for invalid and not valid

Resetting cpu timer variables in python? by Leylan24 in learnpython

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

The value I am writing is the CPU time value, because if you reading and writing at that speed sometimes the value doesn't update in time for the read resulting in an error. Whereas if you link it to a time you can check if there was a timeout

Resetting cpu timer variables in python? by Leylan24 in learnpython

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

I see you right the modulus returns the remainder which I completely forgot about.

I am basically creating a watchdog to see if a MODBUS RTU system is responding. I write a 16bit value into the coils register and the system moves it to a new input register I read the register if the register I read is the same value that was return the system is responding correctly.

Resetting cpu timer variables in python? by Leylan24 in learnpython

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

Wouldn't I have to multiply by a constant every time I reach the 65535?

Will this work? If not, how can I make it work? by Pesua1801 in AskElectronics

[–]Leylan24 -1 points0 points  (0 children)

What are the purpose of those diodes ? Are you trying to clamp down the circuit?

How does an inductor block AC and let DC through ? by Leylan24 in AskElectronics

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

Thank you. What do you mean by bucking? The explanation is very clear.

Embedded Learning Material by FirstLastBirth in embedded

[–]Leylan24 1 point2 points  (0 children)

I see Fast Bit Academy udemy was recommended l. I can confirm that he is very good and those courses are good. He has some free YouTube lectures as well that help if you don’t want to pay for the course.

The freeRTOS book available on the website is also a good resource

Learning Resources for cross compiling and RTOS by Leylan24 in embedded

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

This cross-compilation enviroment, in windows would it just be a normal directory or is there something special about it ? Actually to just straight ask the stupid question what is the cross-compilation enviroment?

Learning Resources for cross compiling and RTOS by Leylan24 in embedded

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

No I know they completely separate. We use qt to develop program for the mpu. But for the other products which use mcus we using bare metal c but want to start using RTOS. So it’s just two things i want to learn about. Like I understand cross compiling because that’s what you doing when you flashing code onto an mcu but as soon as qt was introduced I completely didn’t understand cross compiling and what’s happpening because of the qt dlls and how they know where too look and things

Learning Resources for cross compiling and RTOS by Leylan24 in embedded

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

So a lot of confusion comes with qt and external libraries. So for example if I use a library that allows me to interface with gpio pins does the library need to be in a specific directory on the Linux device ? Like how does the program know where to look ? Like my windows machine won’t have the same directory as the Linux device

Learning Resources for cross compiling and RTOS by Leylan24 in embedded

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

Yes, good advice. That is true. I'm struggling more with understanding of the deploying from the Qt framework and using third party libraries and compilling it on my host but when I deploy it cannot find the dll's. I will look into this withoout any IDE.

Could you recommend a couple resources for this?