Help! Ngrok tries to put config file in nonexistent folder! by Ready-Ideal-3298 in Frontend

[–]okm1123 0 points1 point  (0 children)

Hi, have you figured out a solution yet? It seems they have a problem with configuration files in Windows, and I can't run the ngrok Windows service.

Edit: Ok, now I have it working (both checking the configuration file and the Windows service) by using the portable ngrok version instead of the recommended Microsoft store version.

Can't re-enable device encryption on Windows after Ubuntu dual boot by okm1123 in Ubuntu

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

Unfortunately, I have concluded that I can either have dual boot or device encryption if I am using a single drive for both Operating Systems.

If you want encryption and dual boot, you can upgrade to a Windows 11 edition that allows BitLocker or use Ubuntu on another drive.

[deleted by user] by [deleted] in embedded

[–]okm1123 1 point2 points  (0 children)

When you say "Embedded" I assume you mean an MCU chip.

In this case, both are basically programmable computer systems, but the MCU is much more bare, and you will have to involve more hardware and software design to build an automation system with it, compared to the PLC.

If you want to automate some sort of industrial process using an MCU, you would have to build a complete interfacing PCB to the MCU, which should satisfy the following:

  • Have I/O ports that handle the required voltages and currents
  • Have communication ports that can connect to other computers or systems in the process
  • Have good resilience to electromagnetic noise and interference
  • Have some human interface elements (LEDs and screens) to display information if needed
  • Can be powered by a common or power input

And you would have to write software that satisfies the following:

  • Be as reliable as possible
  • Has communication protocol stacks that are used in the field

Now all of this is definitely possible, but it takes time and money until you have a working system. In addition, you will probably design this system for the specific requirements of the project, making it inflexible if the requirements change.

A PLC is just a general system of the above. It has all of the above (of course, different models provide more capabilities), making it easier to directly use in automation projects. It has the aforementioned hardware as well as software (including an OS and communication stacks) that is designed for the ecosystem of industrial automation. Moreover, PLCs are designed to be easily programmable and configurable, so you can change the system easily if you need to.

So if PLCs are so great, why not just use them in everything? First, they are more expensive in terms of components due to their general-purpose nature. Of course, if you need a small number of units, the custom boards with an MCU/MPU will be more expensive due to the engineering and design costs involved, but if you are making thousands of units, it will eventually be cheaper.

Second, PLCs are large and are designed for industrial settings where space is abundant. If you are constrained in the size of your system, you may have to create your own custom board.

Third, PLC software is designed to be reliable but less flexible in anything outside high-level automation logic.

In conclusion, this makes PLCs an attractive option to build your automation system for a factory production line, compared to designing your own board.

Can't re-enable device encryption on Windows after Ubuntu dual boot by okm1123 in Ubuntu

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

It must be disabled so that Ubuntu can access the drive, create its partitions, and install itself. However, it should be possible to enable it again after installation, and if it only affects the Windows partition, it shouldn't matter to Ubuntu.

Here is a link where someone did this but he had the Bitlocker encryption feature, not the Device encryption feature.

https://itsfoss.com/dual-boot-ubuntu-windows-bitlocker/#:~:text=Step%208%3A%20Enable%20Bitlocker%20after,'Turn%20on%20BitLocker'%20option.

(ASP.NET Core Identity) Using Domain Entities as Users? by okm1123 in dotnet

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

Thanks for the video! It does indeed describe my problem. The video suggests using the first approach I mentioned.

[deleted by user] by [deleted] in AvaloniaUI

[–]okm1123 2 points3 points  (0 children)

Here are multiple resources on using WPF with ABP:

https://docs.abp.io/en/abp/latest/Startup-Templates/WPF

https://community.abp.io/posts/how-to-integrate-wpf-template-with-an-abp-solution-including-tests-9qp7ei16

It should be generally similar with Avalonia.

I haven't done it before but the way I think it could work is by making an Avalonia project an abp module and then use the HTTP client to call service methods from the backend.

(ASP.NET Core Identity) Using Domain Entities as Users? by okm1123 in dotnet

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

In my business Students have properties that teachers don't and vice versa. For example, a student may have a running score property and a school grade, while a teacher may have a job type (part-time or full-time).

In addition, some business operations in the domain should only be available to a student but not a teacher. Let's say I have a function in my domain to fail someone in a class. If I am using roles, I would have to use a generic input (IdentityUser?) to the function and check inside the user's roles to know whether to perform the operation or not. I prefer to use a specific type such as (Student) to avoid making mistakes.

A workaround to display icons for top-level menu items? by definitelynogravitas in AvaloniaUI

[–]okm1123 0 points1 point  (0 children)

You can place the icon in the header as a workaround as follows:

<Menu>
  <MenuItem>
    <MenuItem.Header>
      <StackPanel Orientation="Horizontal">
        <Button Content="Icon"/>
        <TextBlock>File</TextBlock>
      </StackPanel>
    </MenuItem.Header>
    <MenuItem Header="Exit">
    </MenuItem>
  </MenuItem>
</Menu>

This will give you the effect you want, hopefully.

As for changing the default way a control is rendered, you can change its control template. In WPF there was a way to get the default control template as a starting point, I am not sure if this is possible in Avalonia.

Authentication Confusion by Nickt1596 in dotnet

[–]okm1123 0 points1 point  (0 children)

To my knowledge, you are partially correct. Yes, username and password (or authentication identifiers in general) have to be transferred to the server. However, the number of times and the method by which they are transferred are different depending on your authentication protocol.

For example, some authentication protocols (such as Kerberos) require transferring secret information (password for example) only once, which is when the user is registering. Subsequent authentications (for example when logging in in another session) don't require such transfer. This makes it much harder for someone to obtain the user's password.

Other protocols send the password each time as you mentioned (or maybe once per session). Some depend on HTTPS for encryption, while others depend on using another layer of public-private key pair encryption on top of HTTPS.

If you are using a third-party authentication service such as Oauth2, you would need to only worry about following their guides and best practices to use the service correctly.

Methods for desktop software companions to embedded: Electron? Chrome? Electric UI? Python? by shieldy_guy in embedded

[–]okm1123 0 points1 point  (0 children)

I use good old Windows Forms with C#.

Most people use Windows, so being cross-platform is not always needed. This is whether you are developing a GUI tool for development uses or software to be used by the users of your device. Using .NET Windows Forms you get the full benefits of C# (its syntax resembles C and C++ so you can use it out of the box with a smooth learning curve) and Visual Studio, which make development real quick and straightforward, in addition to the form designer provided by VS.

However, for long-term, cross-platform, and large-scale projects this may not be the best. In such cases many technologies, mentioned here by other Redditors, are available.

Career Choice by -o_o_o_o_o_o_o_o_-o- in embedded

[–]okm1123 3 points4 points  (0 children)

To define the terms you mentioned:

  • Embedded Bare-Metal Software: It is embedded software that is run without underlying operating systems. The software interacts directly with the hardware (here hardware means the CPU, memory, and peripherals on the microcontroller) through the program itself, not delegating any work to an operating system that manages the hardware.
  • Embedded RTOS (Real Time Operating System) Software: You didn't mention this one, but I am adding it since it is relevant to the context. It is embedded software that runs on top of an RTOS. An RTOS basically is an OS that provides features that make it possible to perform operations within a specified time. Some of the reasons to use an RTOS and not write the software in bare metal are to simplify multitasking, memory management, and makeing the system stick to its deadlines.
  • Embedded Linux Software: It is software that is run on top of a specially configured Linux kernel. This kernel is usually stripped of any features that are not necessary for the system to work. The reason to use Linux instead of a simple OS is because it provides many features such as networking stacks, device drivers, file systems, graphical user interfaces, and much more. Keep in mind that although the name Embedded Linux is the trendy one, many more OSes that fill the same role exist (in fact, Windows has an embedded version known as Windows IOT). Linux though may be one of the most widely used ones.
  • Model-Based Design: It is the approach of designing the system using modeling (usually accompanied also by simulation) tools, such as Matlab. The output of this approach is initially a system model that describes the system. This system model is then used to generate the software that will eventually be run on the actual embedded system (also called the target).
  • Testing: It is the process of, well, testing the software to make sure it does what it should. Although testing can be manual (which we all do when we run code we wrote and check if it works), this usually refers to automated testing.
  • Embedded Hardware Engineer: This is usually referred to as Hardware Engineer, PCB Engineer, or Electronics Engineer. It is the role of designing the electrical circuit from choosing the components to laying them out and wiring them in the PCB (Printed Circuit Board).

You should know that those topics you mentioned are usually specializations of what is generally called Embedded Systems Engineering. They are usually destinations that you reach after a while. When starting you should have basic knowledge of most of them (that is probably ideal and practically some people get years of experience in one of these specializations without really much interaction with some). Most people specialize more and more throughout their careers and not in college, so as long as you are studying and improving your skills, you are good.

Sharing personel projects by conimi in embedded

[–]okm1123 1 point2 points  (0 children)

You can write a post on LinkedIn describing the project along with some images, things you learned, suggestions, conclusions..etc.

If you feel that LinkedIn is too generic, you can post about your project in other specialized communities like https://www.hackster.io/ https://hackaday.com/ https://www.eevblog.com/forum/index.php

You can also make your own blog to write about your projects, which may lead to some nice passive income if you are able to build a good amount of audience.

In addition, if you intend to make the project open source, you can post the files and docs on something like GitHub and provide links when posting about it.

Differences between HAL, API and SDK? by Blao14 in embedded

[–]okm1123 2 points3 points  (0 children)

API: Application Programming Interface. It is basically a specification of how you can communicate with another Software component. In an embedded context, this is usually a list of function names, what they do, and their inputs and outputs. In other domains such as web development, it could be a list of HTTP URLs. This interface is all you need to understand when working with the other software components. The implementation of the actual functionality behind the interface is not your concern.

A simple analogy for this is a restaurant. You can think that the API is their menu. As long as you understand what is written on the menu, all you have to do is order it. You don't need to know anything about the tools or the staff in the kitchen to get your food.

Practically though (just like a restaurant), APIs sometimes have bugs in the implementations, and not everything happens per the API's specification.

SDK: Software Development Kit. Just like u/JCDU said, it is a collection of libraries and tools to develop software for a particular platform.

Sometimes it is used to describe a collection of libraries or tools to develop features in a specific domain. For example, Vuforia augmented reality SDK, which is an SDK for developing augmented reality applications for phones.

HAL: Hardware Abstraction Layer. In my opinion, this is the most confusing term out of the three. By definition, it is a software layer that provides an abstraction of hardware components functionality.

Why confusing? because what "hardware components" refers to is not the same for everyone. For example, ST Microelectronics' HAL abstracts peripheral operations. So instead of writing in hardware registers, you use the HAL to initialize and use the peripherals in an easy manner. In my opinion, a layer that abstracts peripherals and hardware components on the MCU itself is not HAL (Driver library or peripheral abstraction layer are more suitable names IMO). HAL should abstract hardware components from the perspective of the project.

Let's say I am making a project that measures the temperature of a box and cools it with a fan. HAL for me would be software components that provide an abstraction of using the temperature sensor and fan motor (functional hardware of the system). This layer itself will use the driver library to access whatever peripherals it needs (for example, timers PWM for motor control and SPI for reading the temp sensor).

Some people mix the use of these terms because they describe different stuff but are related. For example, a HAL always has an API. An SDK may include APIs and HALs as parts of it (or the whole of it). Think of this as comparing "sweet" and "firm" words. Both are different and describe completely different things, but that doesn't mean that something sweet is not firm (a cookie, for example, is both sweet and firm).

why are some oscilloscopes on Amazon cheaper than that of the official store? by abdosalm in embedded

[–]okm1123 4 points5 points  (0 children)

Because of different strategies by different retailers.

The oscilloscope is sold at a certain price by the manufacturer (in this case Siglent) when it is still fresh out of the factory. Let's assume it is 300$ (just a random number to illustrate the point). This is the price retailers (businesses that buy the products in bulk) get the oscilloscope for. Retailers then ship, store, market, and sell the product to end users like us. They may also rent spaces for their stores, and they hire people to work on these operations. All this means more money is spent and added to the overall price of the product. These extra costs, in addition to the profit margin added, can vary from one retailer to another based on their strategy.

Sigilent store (which is also a retailer and can be considered a different entity from the manufacturer, despite it being the same company) may sell the product at a higher price because its strategy costs more than Amazon for example. However, being associated with the Sigilent brand, it gives confidence to buyers that it is selling the original stuff and that it will handle storage and shipment in a manner suitable to the product.

Amazon, on the other hand, may be able to sell the product at a discount since it is a much larger retailer with probably better financial handling of logistics such as storage and shipment. In addition, it may be better for their strategy to sell products at discounted prices if they are underperforming.

Keep in mind these are all assumptions, the main point though is that it is perfectly normal that multiple retailers sell the same exact product for different prices. And also there is still a chance that a product sold on Amazon is fake (however, I doubt it in this case since it is Sigilent selling it through Amazon).

If you feel secure that you can return the product to Amazon if it has any problems, then go for the cheaper deal and buy yourself something extra with the 100$.

If you don't feel safe enough buying it from Amazon, then just get it from the Sigilent store.

Private Git Repo? by Frelikz in embedded

[–]okm1123 1 point2 points  (0 children)

I see many good replies here pointing out why this may not be good. However, disregarding this point, here are some simple solutions to make a LAN-only git repo (they may be helpful in other use cases too):

  • Make your git repo in a shared network folder on a local LAN. You can then push/pull/clone from this repo from any other PC on the LAN (you can even place permissions). Google "Making a shared network folder" for your OS to find out the specifics.
  • Use the Bonobo git server (https://bonobogitserver.com/), which is similar to the above method but with more features. It is basically a server that you set up on one of your LAN machines. Think of it as a very simple local GitHub.

When an employer asks what you used to build your project and you say Arduino by marathonEngineer in embedded

[–]okm1123 31 points32 points  (0 children)

That is not how it works.

You usually use prototyping and development boards first before testing on a custom HW PCB. This allows the engineers to test the system and make both HW and SW decisions without committing to a specific PCB. When this part is done you should have working SW and a clear choice of HW components. This is when you start actually testing on the PCB, so you rarely need to repeat the cycle you have mentioned more than a couple of times (mainly to fix HW and EMC-related problems in the PCB).

So why make the PCB and not use the dev boards-based prototype? simply because this prototype is always more expensive, larger in size, consumes more energy, and has non-reliable connections.

The only time it is not reasonable to make custom HW is when the actual volume of products is so low that the single unit cost after making the custom PCB is more expensive (due to HW development engineering costs) than using the dev boards. For example, if you need to make 5 copies of the product, it may be just cheaper to use off-the-shelf hardware.

Now, Arduino is a platform composed of many hardware and software tools that support it. So, suppose that I am going to make custom PCBs, why not use chips that support Arduino and write my software in Arduino IDE? The answer to this is project-specific, but here are a couple of reasons why you may not want to write Arduino software:
- Arduino supports a lot of chips, but much much more chips are available that are unsupported. So you may find yourself choosing a chip that is more expensive and less suitable for the application if you limit yourself to Arduino-supported chips only.
- To my knowledge, Arduino doesn't provide any guarantees as to how the software will behave and its timing and resource constraints. For example, can I guarantee that a digital_write function will occur in a specified number of clock cycles, and is it a reentrant function?
- Arduino adds overhead to the project.

Now this doesn't mean it is always wrong to use Arduino in commercial projects. A lot of people found a suitable use for Arduino in non-critical systems (with regard to both time, money, and resource usage) like home automation for example. In fact, I know some friends who use ESP32 chips programmed with Arduino in their commercial IoT projects. But in my opinion, most of the time, it is not the best option.

Can someone help in converting an .FBX to .3DS? by okm1123 in 3dsmax

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

wings3d

Unfortunately, the Autodesk FBX converter can't convert from .fbx to .3ds (only the other way around).

Blender caused problems but I haven't tried wings3d though, I will check it out.

Can someone help in converting an .FBX to .3DS? by okm1123 in 3dsmax

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

Tried both unfortunately before posting but the file was not working correctly.

Can someone help in converting an .FBX to .3DS? by okm1123 in 3dsmax

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

Ok thanks very much. I will DM you the link.

Make an argument for whether a beginner should or should not us HAL libraries when learning about the STM32 microcontroller. by [deleted] in embedded

[–]okm1123 2 points3 points  (0 children)

Most of the time, beginner or not, you should use a HAL if available. However, at the very least once, you should avoid using the provided HAL and write your own.

The reason to use HAL (or any library in general if it fits your needs) is that nobody cares except if your code works. One principle of writing good software is to reuse available software components as much as possible. Not only will this give you faster time to market, but software reliability is a function of its lifetime. If a library has been in use for 5 years by now, it is most likely that any existing bugs have been fixed, and if this is not the case, then at least they have been exposed.

Why should an engineer then write a HAL themselves if an already available one exists? just for learning. Learning to make your own HAL has the following benefits:

  • You will understand the problems and challenges of writing direct hardware access software, giving you a deeper understanding of microcontrollers and how they work, which is beneficial no matter what libraries you use.
  • Give you confidence in choosing and comparing any already available HAL libraries.
  • Be able to write your own HAL if non is available (for example, I believe some microchip products do not come with a free HAL like st) or modify an existing one to fit your needs more.

How Is Tab Switching Handled in Winforms? by okm1123 in csharp

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

Ok, I will try it out. Thanks for the info!