[Solved] Modifying buffer size - access denied in Windows 10

  • SOLUTION: UNINSTALL THE CRAPPY WINDOWS STORE APP AND DOWNLOAD THE .ZIP VERSION

I'm using the Arduino IDE from Windows 10 App store.

I'm trying to modify my HardwareSerial.h file to increase the RX buffer to 256 bytes.

However, when I click "save" it says "Access Denied" even though I tried the Notepad "Run as Administrator" trick. I have only 1 user on this PC.

The file is in:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.5.0_x64__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino\HardwareSerial.h

How can I modify this file or increase my buffer another way?

You assume a permission problem. The file may be marked read-only.

I'm trying to modify my HardwareSerial.h file to increase the RX buffer to 256 bytes.

Why?

[quote author=Coding Badly link=msg=3283637 date=1496278553]

Why?

[/quote]

I'm using a PC to send commands to my MEGA. The PC is very quick and I'm parsing the data using a state-machine - can't guarantee that I'll empty the buffer faster than the PC can fill it.

I can do some acknowledgement tricks but I have a multi-threaded application (C#) and it will get messy. Increasing the buffer size is a quick fix.

I've been playing around with permissions/security for the last half hour using this guide:

https://support.microsoft.com/en-us/help/2623670/-access-denied-or-other-errors-when-you-access-or-work-with-files-and-folders-in-windows

but still says "Access Denied" when I try to save my change on the HardwareSerial.h file.

The PC is very quick

The PC speed is nothing to do with! and get over the stupid idea that the AVR's are slow in real terms for the work being done they are not!

Mark

MicroBubble: but still says "Access Denied" when I try to save my change on the HardwareSerial.h file.

[quote author=Coding Badly link=msg=3283637 date=1496278553] You assume a permission problem. The file may be marked read-only. [/quote]

Did you check for read-only?

MicroBubble: Increasing the buffer size is a quick fix.

Either the MEGA can keep up or it cannot. If it cannot (the purported reason for increasing the size) then you are delaying the eventual failure rather than preventing it.

But, it is your application.

Try using the regular IDE instead of the Windows Store version.

At 9600 baud, it takes roughly 1ms for a byte to be transmitted regardless of the speed of the PC; an Arduino can do a lot of things in that time. You can do the calculations for other baudrates.

What is the application that sends the data to the Arduino? If you wrote it yourself, you can modify it to slow down. E.g. wait for an acknowledge from Arduino before sending the next bunch of data, make use of software handshake (on/xoff) if you're using text-based communication.

pert: Try using the regular IDE instead of the Windows Store version.

Right there is the quickest and easiest solution.

Windows store is an abomination. Avoid.

Anyway, is ownership right?

The worst thing is the Windows Store version is at 1.8.5.0 now for some reason, which will have no relation to the regular IDE version 1.8.5 when it comes out.

There is probably no need to increase the Serial buffer size. Have a look at the examples in Serial Input Basics - simple reliable ways to receive data. In the demo the array for received data is 32 bytes but you can change that by changing the value of numchars

...R

Robin2: There is probably no need to increase the Serial buffer size.

+1

I'll bet you're using delay.

-dev: +1

I'll bet you're using delay.

How much do you want to bet?

@MicroBubble, given the fact that you returned to post something inane I assume you solved the problem. For the benefit of anyone else who encounters the same problem please post your solution.

pert: Try using the regular IDE instead of the Windows Store version.

This did the trick!

How much do you want to bet?

Then there is some other blocking operation; delay is the most common offender. If you had posted your code, we could have identified it and made a suggestion. Increasing the buffer size is rarely the correct solution. It does happen, but it's unusual for a new poster to have a real need for the "sledgehammer" approach.

I know this is an old thread but just wanted to include that I fixed the permissions problem by right clicking hardwareserial.h and changing file permission in the 'properties' tab