Thursday, April 30, 2020

Memories... VUCA

Ah... just saw the acronym VUCA being used in an article I was editing for work. VUCA stands for volatile, uncertain, complex, and ambiguous. It originated from a military context. I saw this term many times when I was in the navy, so seeing it being used today in a different context was refreshing.

Japan considers changing of school year period

Abe to consider Sept. start of school year amid coronavirus closure

To me, this is just another example of reactive politics. It is short-sighted and cowardly. Because they are just running away from a problem by trying to adopt another idea that has not been studied properly.

Yes, there are merits to aligning the start of the school year with other countries. But a change in the start of the school year is not a small thing. It does not just impact students. The impact is to the entire society, as parents need to adapt to the change. Companies who hire people need to be able to handle this change. There are many aspects to be considered for such a major change, and my worry is that trying to implement this in a short few months will mean the issues are not being properly studied.

And we know what happens when we try to implement a policy in Japan without properly studying the issue.
Private English tests for Japan university entrance exams delayed after minister's gaffe
This was just half a year ago. The education ministry really can do without having another gaffe. But while the entrance exam policy botch affects a portion of students, the changing of the school year affects the entire society. A lot more time and effort needs to be put in before it can be implemented. To talk about this lightly is a sign of short-sightedness and just plain stupidity.

The real problem that the education ministry needs to be handling is the problem of home-based learning as a contingency plan. The recent school closures have highlighted this problem. Japan does not have a contingency system to handle widespread disruption to the school system. And this problem will not go away by shifting the school year to start in September. If a second wave of infections hit in autumn, we will still be faced with the same problem of school closures. What then? Shift the school year again to start in April?

Spend the money to put in place a contingency system for home-based learning. Once that system is in place, the education ministry can work with other ministries to study into the actual impact of shifting the school year to start in September.

Implementing home-based learning is costly. But avoiding the issue just because it is costly is irresponsible and cowardly. Shifting the school year is not a solution, it is just avoiding the problem, trying to look like politicians are doing something, when they are just kicking the can down the road, and making the private sector and families deal with the impact.

Any politician who even speaks about this again better answer this question first: what happens if there is a second wave of infections?

Monday, April 27, 2020

Playing the media game

When COVID-19 first broke out in China and countries in Asia, Western media focused on highlighting how Asian democracies like Japan and Singapore were able to keep infection levels low without resorting to the draconian lockdowns implemented by China. Implicitly, it was the democracy vs communism story, to show that democracies are "better" than the authoritarian communist China.

But COVID-19 does not choose its victims based on ideology.

So when infections rose in Europe and the U.S., and death tolls started to exceeded even China, Western media needed to play a different tune.

And so you see the Western media recently to portray Singapore as failing after its initial success. About how Abe mismanaged the handling of COVID-19. The implicit message is that the failures of Western democracies in handling COVID-19 are not exclusive to the West; we see such cases all over the world. The second message carried by Western media was about how China must be manipulating its numbers; how could it be so much lower than what we are experiencing elsewhere?

My gut feeling tells me that China's numbers are off. But I have no proof of that; it is a feeling, not a fact. The fact, though, is that China is slowly opening up, and we have no reports of mass graves that would definitely have leaked if China's fatalities are being grossly underreported. So most probably, China's numbers are slightly underreported, but those numbers still differ from the U.S. by a factor of 10. A factor of 10. In a country with 4 times the population, China has 10 times less fatalities.

Singapore would need to have fatalities of around 1,000 in order to be on par with the U.S. at the per capita level. Instead, as of now, Singapore has less than 20.

So what went wrong? Instead of trying to portray other countries as "failing" and "liars", the Western media should be focusing on what their own governments are doing to keep their own people safe. A free press is essential to keep the government on its toes. When the free press fails to take up that important role, and instead falls into propaganda to implicitly defend its own government, it is then just as guilty as a government that fails in responding to COVID-19 properly.

You don't need to waste time trying to find others to blame, trying to find examples outside to justify your failures. You should be spending all that energy on making sure you are doing the right things.

Saturday, April 25, 2020

Using Mesa framework to simulate the spread of COVID-19

First, a disclaimer. I am not a medical professional, I am no expert in medical or health science. I am just a person who studied computer science and has an interest in multi-agent simulations.

Okay, so with the global spread of COVID-19, and many many people trying to use their programming and data science skills to model COVID-19, I thought I would use it as an example to learn the Mesa agent-based simulation framework.

Using Mesa, I made a simple simulation. In it, the population starts with an initial percentage of people infected with a disease. They have a chance of spreading the disease, a chance of dying for it, and after a fixed period, they recover from it. Recovering from the disease also grants a certain chance of immunity from subsequent infections. At the start of the simulation, a certain percentage of people would be in "stay at home" mode. When people become infected, they have a chance of being put into quarantine, and people in quarantine no longer infects others.

Here is when a 100x100 grid with a population density of 30%, an initial infected population of 5%. When 50% of them start off in "stay at home" mode, eventually, almost everyone still ends up getting infected.


When that "stay at home" rate is 80%, a lot of people still get infected eventually. But the peak number of infections is less. I guess that is what they meant by flattening the curve.

In addition to plotting the results as charts, the Mesa framework also allows visualization in a web browser. Here is the 50% stay at home case as an example.


The source code is available here for everyone to tweak and experiment.

To set the scenario, edit the parameters in run.py.

Then, to run the scenario, use python3 main.py which will produce a chart at the end.

If you want visualization on a web browser, run server.py instead.

If you add in new parameters in run.py, you will need to edit model.py to read those parameters. Then, edit model.py and person.py as necessary to handle those parameters. model.py deals with the entire simulation, while person.py is the behavior for each person (agent).

Feel free to tweak the model. At present, the model is very simplistic because it does not account for hospital capacity, severity of infection, and many many other real-world factors. You will need to consider these factors for accurate modeling. My goal was just to create a simple simulation to learn how to use the Mesa framework.

Side note: I somehow feel the Mesa framework is a bit bloated. So I will see if I can find a way to develop a simulation that uses Python with some other framework for visualization.

Wednesday, April 22, 2020

Connecting MRR ESPA to Labists Mini 3D printer (aka Easythreed X1) part 2

Connecting MRR ESPA to Labists Mini 3D printer (aka Easythreed X1)

So I did a bit more testing since I managed to get it to work with the MRR ESPE. Could it be the use of 3.3V on the STEP/DIR? It should not be, since the MRR ESPA has been working fine in that past.

I know that the stepper routines were given quite a bit of changes recently (see PR #16128) and that led me to think: could it be that the new changes to the stepper routines have affected the MRR ESPA? I went to flash the old Marlin fork by luc-github, and lo and behold, it worked just fine.



Hopefully, someone on the main Marlin team is able to help with this issue. I don't know if it affects others using 12V systems with A4988 stepper drivers. Another hunch I have is the high clock speed of the ESP32. Of all the microcontrollers being supported in Marlin, the ESP32, with a clock speed of 240 MHz, probably has the highest clock speed. This may be why any attempt to tune the stepper routines for slower clock speeds will likely end up affecting the MRR ESPA. The MRR ESPE is likely not affected because while it has the same CPU clock speed of 240 MHz (being based on the same ESP32 microcontroller), this is scaled down to a much lower frequency when shifted through the I2S stepper stream.

Anyway, I am keeping track of the issue here.

Get the MRR ESPA board here.

MRR ESPA and MRR ESPE related social media:
Facebook page
Facebook group for users

Affiliate link to Labists mini 3D printer on Amazon.com

Monday, April 20, 2020

Suing China for damages from COVID-19

US lawyers sue China for TRILLIONS of dollars as they accuse Beijing of negligence for allowing coronavirus outbreak to erupt before covering it up

As COVID-19 spreads and disrupts economies worldwide, people have started to band together to take class action against China. Taking China to the courts to sue for trillions of dollars in reparation sounds like a great way to pump money back into all those economies wrecked by COVID-19.

It makes people feel good to look like they are taking on the giant. David versus Goliath.

But there are definitely problems in their argument. For one, China's best defence would be that the damage to economies was not due to China's negligence, but rather the negligence of other countries in failing to act after China has filed its notification to the WHO on 31 December 2019. Any country which did not take any form of substantial action in the first two weeks of the notification can rightly be argued as having neglected to take the warning seriously. After all, in those initial weeks, Taiwan took strong action and it has saved Taiwan from having to enforce widespread lockdowns like those in Europe and the United States. Taiwan has unwittingly became evidence that heeding the notification from China actually can work.

And if China manages to argue its way out of this case, it can turn the tables. It can sue the U.S. for failing to take adequate steps to prevent the spread of the virus in the U.S., thereby causing a global recession (and maybe even depression) as the world's number one economy goes into lockdown. The problem for the U.S. is that China would not be wrong. There is enough evidence in the public domain to show what the U.S. has (or has not) done to prevent the spread of COVID-19 within its shores. It is especially problematic for the U.S. because President Trump spent much of February downplaying the threat of COVID-19, and that evidence is widely available. For an economy that is already taking damage from the lockdown, any further need to compensate the rest of the world will throw the U.S. economy into a pit that is going to be extremely difficult to climb out from.

So while it may make the plaintiffs feel big and important as they pretend they are David taking on Goliath, the truth is that they are more like David walking to face Goliath without staff, sling, or stone. It is brave to take on a giant, but bravery and foolishness are divided by only a thin line. If they want to do foolish and futile things to make themselves feel good for a while, they can always smoke weed.

Saturday, April 18, 2020

Reading "COVID-19 & China: A View from Asia"

COVID-19 & China: A View from Asia

As everyone is stuck at home, and politicians go around pointing fingers at each other trying to shift blame, while some slog on to defeat this virus, I thought I would share an article by George Yeo, who used to be Singapore's foreign minister.

Could China have done better in its initial response? Definitely. Were there mistakes with China's figures? Of course. But we know all these because hindsight is 6/6 (or 20/20 for those in the U.S.).

The fact of the matter, though, is that China did worked hard to contain the virus. It shut down a major city, followed by an entire province, with the rest of the country close to lockdown. Any credible scientist will tell you that if China did not do this, we would be looking at a very very different situation now.

The question we need to ask is: why did different countries react differently to China's notification to the WHO about the novel coronavirus?

Taiwan and Singapore are great examples. These two took early action; Taiwan's reaction started on December 31, 2019, while Singapore took action starting from January 2, 2020. Taiwan's initial response was firm probably because of geopolitics and a long history of dealing with China. In contrast, Singapore's responses looked weaker, but we must remember that Singapore is a small country heavily dependent on trade, and China is a major trading partner. I would dare say Singapore did the most it could given the economic and geopolitical circumstances.

Meanwhile, Abe was trying to downplay things in Japan so as not to affect his beloved Olympic Games. Trump was probably too distracted by his impeachment to seriously think about how the U.S. should respond. Most other countries were slow to act too. Remember, China is a major trading partner for almost every country, and I believe economics played a significant role in the decisions of leaders all over the world. Couple that with the WHO's reluctance to raise the alarm (again, likely due to political and economic considerations), and leaders around the world had even less political backing to be able to take strong and quick responses.

So where do we go now, after most of the world has squandered away the two months that China bought us?

We can continue to try and blame China and the WHO. We can continue to foster conspiracy theories. But those actions will not contain the spread of the virus, and does nothing to save lives.

Alternatively, we can stop the blame game, shut down conspiracy theories, and focus on doing what we can to contain the virus and eventually defeat it. And that is part one. Once we have the virus under control, we need to focus on rebuilding our economies.

There is a lot to be done. Pointing fingers and writing farfetched tales won't help us finish those tasks.

Thursday, April 16, 2020

COVID-19 and politics

These are just some random thoughts about how COVID-19 and its link to politics, looking at the leaders of three countries: China, Singapore, and the U.S.

In the U.S., Trump has tied himself so closely to the handling of COVID-19, it will become impossible for him to shirk any responsibility of failures and mistakes. By appearing daily in front of the nation and talking about COVID-19, he has implicitly taken ownership of the problem, even as he tries to blame previous administrations, China, and the WHO. This is truly a gamble: it will be a political bonus to his reelection if there is a significant improvement in the COVID-19 situation within the next month or so. Otherwise, if the situation continues to worsen, or just carry on without improvement, his frequent appearances in the media fronting the response to COVID-19 will only reinforce in people's minds that the situation they are in is all thanks to him. For the well-being of the American people and his political career, I can only hope he succeeds.

Looking at China, Xi took a different approach. He rarely appeared in the media, but he used his media appearances to show that he was concerned with this situation. His hands-off approach was probably aimed at distancing himself from whatever the political outcome of COVID-19 could be. If things turn out well, he could always get people to praise him later. But if not, at least he could try to limit the political impact (aka blame the local government). State control of the media largely allows him to spin any story after the fact, which may explain his decision to avoid tying himself to COVID-19 until he can be sure it has a positive impact on his own political standing.

For Singapore, Lee's approach is from another angle. Like Xi, he made very few media appearances. This could be because he is the face of the party, and while Xi has the luxury of falling back on blaming the local government if things turn bad, Singapore's national government is the local government. There is no one else to blame. This may explain why Lee tries as much as possible to downplay any politics in the handling of COVID-19, keeping out of the media as far as possible to avoid giving the impression that he (and by association, the party) is fronting the fight. In Lee's case, he does not need the political benefits for himself, since he is likely to pass on leadership of his party to the next generation of leaders. What he is concerned with is maintaining the legitimacy of the party for this baton-passing to take place.

Is there a good or bad to this? Not really, but it is interesting to see how they each handled the situation differently. Trump's entanglement in the COVID-19 fight can turn out both ways, and the political benefits can be huge for him; it can also be disastrous. Xi knows he can spin the story post-fact, so he is in no rush to claim ownership. Lee needs to maintain party legitimacy, and knows that the party can claim ownership of positive impact post-fact too; the priority then, is to ensure that the party can steer the situation toward delivering positive impact that it can subsequently claim.

Meanwhile, I only hope that through collective and individual efforts, we can bring an end to this in the near future.

Tuesday, April 14, 2020

Tips for working from/at home

Having quite a bit of experience working from/at home, here are some tips that I wish to share for those who have to do this for the first time.

1. Wake up on time
It is easy to sleep in when working from home, but I always wake up by a certain time each day. This helps to get you into the "mood" for work.

2. Wear working attire
When working from home, it is possible to stay in your pajamas the whole day. But being in pajamas can be too comfortable for work, making you lazy. So I like to change into something just to feel like I am at work. This includes putting on make-up too. Basically, it should be just like working at the office.

3. Start work on time
Sticking to a schedule helps. At home, there are many distractions. TV, the laundry, washing the dishes, and other things can draw our attention. To help us resist those distractions, starting work on time is important. It forces us to drop those distractions.

4. Take a proper lunch break
On busy days, it can be easy to work through lunch, dinner, and even sleep when working from home. But that is not healthy, and not sustainable. Even on busy days, I try to set aside time for a lunch break at least 45 minutes long. The same goes for dinner, if working overtime.

5. Set aside a working area
If you have the luxury of a room to work in, good. If not, a designated work area that everyone in the family knows about is important. Not only will it signal to them that you are at work and should not be disturbed, it also helps you to get mentally into the working mood when you are in that designated working area.

6. Keep things you need within reach
Your coffee (or tea) and anything else you need while working should be in the working area. This helps to limit trips out of the working area (except toilet breaks, unless your working area is the toilet), which reduces the chance of you being distracted by all those things in the house, like dishes in the sink, laundry waiting to be folded, etc.

7. Draw up a daily work schedule
I use Google's calendar app for this. I plan my day ahead, setting aside time for every task that I want to accomplish each day. Keeping to this schedule helps to keep you focused. Plan in your lunch break in this schedule too!

8. Limit overtime
For the hardworking ones, it is easy to work well into the night to get things done. Just remember, when working from home, we are usually not paid overtime wages. Pace out your work. Remember Point 7 above. Unless someone is going to die, stop work by midnight, no matter how tight the deadline is. If you work yourself to the hospital (or to death), whoever is paying you will just hire someone else, but your family will have to deal with the consequences of your decision.

The above are my tips for working from/at home. Hopefully, it has served as a guide for those who need to work in a new(?) environment in these difficult times.

Monday, April 13, 2020

RGB LED fan for the hotend

RGB LED fan for the hotend? Why?

Because it can be done.

Recently, I saw a RGB LED 40mm fan for use with Raspberry Pi. So I thought, "It will be so cool if this can be used with a 3D printer." But the problem is that my 3D printers run on 12V and 24V, and this fan runs on 5V. I tried to see if 12V or 24V models are available, but apparently not.

First, I tried to use this isolated MOSFET module. But my testing showed that it cannot be used with 5V on the output side; the minimum voltage on the output side is 9V due to how the module was designed. That meant I cannot use the fan output on my board to control the 5V RGB LED fan.

But wait. I have a few MRR PiFan fan controllers on hand. Can I use the 5V output on my MRR ESPE, coupled with one of the I2S output pins as a GPIO to control the MOSFET on the MRR PiFan?



Apparently, yes.


I turned off the lights to see if the RGB LED effects can be more prominent.

My only worry is that the fan is not pushing enough air to cool the heatsink on my Titan Aero, which will then result in heat creep and clogs. So I will likely be switching back to a normal fan. But still, it was a nice "experiment".


Sunday, April 12, 2020

Isolated MOSFET module reverse engineering

I got a few isolated MOSFET modules recently to test with fans and LEDs. They are basically MOSFETs, but the gate is controlled by an optocoupler to isolate the control circuit from the load circuit.


I tried to see if I can get it to work with a 5V fan on the output side as I was thinking of using my 3D printer control board (running on 24V) to drive a 5V fan. But it seems the minimum voltage for the output side needs to be 9V; it would not run at 5V. The MOSFET gate just does not get enough voltage to open.

I could not find the schematic of this, so I had to do a bit of reverse engineering to try and find out why.






The MOSFET is a IRLR7843. Optocoupler is PC817. Standard stuff, I guess. There is a red LED when the load is being driven, connected to a current limiting resistor. Standard stuff too. The zener diode seems to be there to clip the gate voltage. I had to figure out how the rest of the resistors were connected using a multimeter.

This is the schematic that I think should fit this module.

The resistors R2+R3 and R4 will actually form a voltage divider that halves whatever is the voltage on the output side (VDD in the schematic). This is bad news if VDD=5V, since the gate voltage is then 2.5V, which according to the data sheet for the IRLR7843, seems to be too low for the MOSFET to work normally.

Otherwise, this module should work quite well; just remember to have VDD=9V at least. And the connectors used, while stamped with "10A" on them, don't look like they can handle that much current. I would probably limit any use to 2A.

Friday, April 10, 2020

MRR PiFan: slim fan controller for single board computers

I have a few Raspberry Pi and other single board computers, and most of them do require some form of active cooling (especially if overclocked). A small 5V fan is usually enough, but having those fans run all the time can be a bit noisy over time.

There are many circuits that can be found online to add GPIO control to fans using a transistor or MOSFET. Aliexpress even sells something that plugs into the Raspberry Pi's pin headers like a mini-hat. But most are bulky; the one on Aliexpress kind of sticks out and won't fit inside most cases.

So I designed my own, a slim design that sits over the RPi's 40-pin header. This means it will fit inside cases, but it also covers the pins. Not really a problem for me since I don't use the pins.


The module/mini-hat uses a WST3392 dual-channel N-MOSFET, which I have quite a few lying around because I use them in the MRR ESPE. One channel is used for the fan (which also has a red LED that comes on together with the fan). The other channel is connected to a green LED; use of this LED is optional.

If you don't want to use it as a mini-hat, it can be used like part of the fan's wire. Here is one with 90-degree pin headers, one end which will connect to the fan, and the other to the board. The red and black wires go to 5V and GND, while the yellow to the pin for controlling the fan. The green can be used to control the green LED onboard.


Pin headers can be bulky, so wires can also be directly soldered onto the module. This makes the module even flatter.


Here is the module being used on my RPi4B as a mini-hat, controlling the dual 25mm fans for the "armor" case. You can see that the module fits very snugly inside the case. The female header sits on pins 2, 3, 5V and GND (the topmost set of pins are skipped).


The KiCad files can be found here. A script that can be used to control the module and fan can be found here; you will need to edit it a bit if you want to control the green LED. For me, I changed /usr/local/bin/fancontrol.py to something like:
#!/usr/bin/env python3

import subprocess
import time

from gpiozero import OutputDevice


ON_THRESHOLD = 65 * 1000  # (degrees Celsius) Fan kicks on at this temperature.
OFF_THRESHOLD = 55 * 1000  # (degress Celsius) Fan shuts off at this temperature.
SLEEP_INTERVAL = 5  # (seconds) How often we check the core temperature.
GPIO_PIN = 2  # Which GPIO pin you're using to control the fan.
LED_PIN = 3  # Which GPIO pin you're using to control the LED.


def get_temp():
    """Get the core temperature.

    Read file from /sys to get CPU temp in temp in C *1000

    Returns:
        int: The core temperature in thousanths of degrees Celsius.
    """
    with open("/sys/class/thermal/thermal_zone0/temp") as f:
        temp_data = f.read()

    return int(temp_data)


if __name__ == '__main__':
    # Validate the on and off thresholds
    if OFF_THRESHOLD >= ON_THRESHOLD:
        raise RuntimeError('OFF_THRESHOLD must be less than ON_THRESHOLD')

    fan = OutputDevice(GPIO_PIN)
    led = OutputDevice(LED_PIN)

    led.on()
   
    while True:
        temp = get_temp()

        # Start the fan if the temperature has reached the limit and the fan
        # isn't already running.
        # NOTE: `fan.value` returns 1 for "on" and 0 for "off"
        if temp > ON_THRESHOLD and not fan.value:
            fan.on()
            led.off()

        # Stop the fan if the fan is running and the temperature has dropped
        # to 10 degrees below the limit.
        elif fan.value and temp < OFF_THRESHOLD:
            fan.off()
            led.on()

        time.sleep(SLEEP_INTERVAL)



The following is an excerpt from this article about how to make the script start on boot.
----- start of excerpt -----
Create a file called fancontrol.sh and add the following:

#! /bin/sh

### BEGIN INIT INFO
# Provides:          fancontrol.py
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
### END INIT INFO

# Carry out specific functions when asked to by the system
case "$1" in
  start)
    echo "Starting fancontrol.py"
    /usr/local/bin/fancontrol.py &
    ;;
  stop)
    echo "Stopping fancontrol.py"
    pkill -f /usr/local/bin/fancontrol.py
    ;;
  *)
    echo "Usage: /etc/init.d/fancontrol.sh {start|stop}"
    exit 1
    ;;
esac

exit 0


Move this file to /etc/init.d, and make it executable:

sudo mv fancontrol.sh /etc/init.d/
sudo chmod +x /etc/init.d/fancontrol.sh


Now we'll register the script to run on boot:

sudo update-rc.d fancontrol.sh defaults

Now, you can either restart your machine, or kick this off manually since it won't already be running:

sudo reboot

or

sudo /etc/init.d/fancontrol.sh start
----- end of excerpt -----

Update (December 28, 2020): I just found out that since 2018, Raspberry Pi's config.txt has device tree overlays that allow a GPIO pin to be used to control a fan. All that is needed is to specify the option in config.txt with the GPIO pin to use and the temperature to turn on the fan. For example, to turn on the fan at 55 degrees Celsius with the control pin connected to GPIO 2, add the following line to config.txt:
dtoverlay=gpio-fan,gpiopin=2,temp=55000
The fan will turn off at 10 degrees Celsius below the specified temperature, so in this case, it will turn off at 45 degrees Celsius. However, there is no option to control the LED. The GPIO numbering is the BCM numbering (not board numbering).

Monday, April 06, 2020

Visual Studio Code does not support source control (git) with symbolic links

I was trying to set up Visual Studio Code on another computer (running Linux Mint), and kept running into the situation where changed files do not show that little tag in the workspace, and the editor was not showing where lines were changed.

I thought I had an issue with git and VS Code, so I reinstalled both. But that did not solve the problem. Spent a whole hour searching the Internet trying to hunt down a solution.

And came upon this.

Git: Symlink support

It seems VS Code does not support file watching when folders are added to the workspace using symbolic links. This is obviously a non-Windows problem since Windows doesn't really have the symbolic links that we see and love in Unix-based systems. But the issue was first raised in April 2016... and four years later, it still remains an issue.

And wasted one hour of my life. Plus put strain on my poor eyes... which are already strained from all that work staring at the PC.

Sigh.

Sunday, April 05, 2020

Marlin, ESP32, and RGB LEDs

After connecting the MRR ESPA to the Labists 3D printer, I thought it would be a good idea to try to see how RGB LEDs would work with the MRR ESPA. So I got a RGB CPU fan (120mm) which uses addressable LEDs, and made the following changes to Configuration.h.

#define NEOPIXEL_LED
#define NEOPIXEL_TYPE   NEO_GRB
#define NEOPIXEL_PIN     0
#define NEOPIXEL_PIXELS  8

#define NEOPIXEL_IS_SEQUENTIAL
#define NEOPIXEL_BRIGHTNESS 127
#define NEOPIXEL_STARTUP_TEST


This is the fan.
It has a 4-pin fan connector (GND-12V-TACO-PWM), so I just connected GND and 12V to the MRR ESPA's part cooling fan port. The LED connect is 3-pin (GND-DATA-5V). The DATA line should be able to work on 3.3V, but just in case, I used a voltage shifter to change it to 5V.

Here's the video.

Oh, I also took the chance to test out the TFT35 touchscreen from BIGTREETECH. It works when connected to AUX1. Still, the MRR ESPx boards do not need such a controller since everything can be controlled via the ESP3D webUI.

When the board boots up, it will do a quick cycle test of the RGB LEDs. Also, when a print is started, the color will change to magenta, then slowly turn red as the hotend heat to temperature. Once the print gets underway, it becomes white (this is supposed to help illuminate the print area).

There seems to be some problem with the addressing of the LEDs, most likely because I got the LED count wrong.

Otherwise, it seems the RGB LEDs work!


Get the MRR ESPA board here.

MRR ESPA and MRR ESPE related social media:
Facebook page
Facebook group for users


(Note: I am still having issues with the Labists 3D printer aka Easythreed X1. I seriously suspect it is an issue with the motors overheating, but if I turn down the Vref, the motors don't move. I will next play around with minimum pulse duration to see if it helps.)

Saturday, April 04, 2020

Cinnamon does not go with blueberry

No, this is not about food.

I am running Linux Mint Cinnamon, and had been experiencing serious, visible screen lag. When the computer first starts up, things are okay. But the lag starts to appear after a while.

Eventually, after trying all kinds of stuff, from reinstalling display drivers, turning on and off Cinnamon effects, and many many other stuff, I came upon a post that said that it could be the Bluetooth manager (blueberry) that is causing such lags. So I turned it off... and voila! No more lag!

Sidenote: Older Cinnamon applets can cause lag too. Like some of the older system monitor apps out there. Multi-Core System Monitor (multicore-sys-monitor@ccadeptic23) works for me.