Tuesday, July 31, 2018

Moral conflicts, guerilla campaigns, and how to fight back

Looking at the political situation in the United States, it reminded me of what I read in Colonel John Boyd's Patterns of Conflict.

It is about moral conflict. In his slides, Boyd talked about the essence of moral conflict, of guerilla campaigns, which is basically what is happening now, with Trump fighting a "guerilla war" against the establishment.

But Boyd did not stop at that. He also talked about how to fight against a guerilla force, summarized in a nice slide titled "Counter-guerilla campaign." Which offers insight and hints on how the U.S. media (being constantly bombarded as "fake news") and those wronged by Trump to fight back.

(I shan't try to introduce nor summarize Boyd's concepts. His slides are best read and digested as they are. But I do welcome discussions via the comments section of this blog article.)

It is not surprising that Trump's methods and strategy follow Boyd's concepts. Boyd's concepts have a very deep root in the U.S. military, and we know that Bannon has been (and probably still is) advising Trump. And now that we are clear about the strategy, people can work on a counter-strategy. Which I will leave to those in better positions.

Good luck! And good hunting!

Sunday, July 29, 2018

Adding mDNS to ESP32 camera demo

I was trying to add mDNS to this demo of using a camera (in my case, an OV2640) with the ESP32 to stream video over WiFi to a web browser.

After some trial and error, and looking at examples and such, it boiled down to:

1. Add a function to start mDNS.
static void start_mdns_service()
{
    //initialize mDNS service
    esp_err_t err = mdns_init();
    if (err) {
        printf("MDNS Init failed: %d\n", err);
        return;
    }

    //set hostname
    ESP_ERROR_CHECK( mdns_hostname_set(MY_HOSTNAME) );
    //set default instance
    ESP_ERROR_CHECK( mdns_instance_name_set(MY_INSTANCE) );
}

Remember to declare the function! And define MY_HOSTNAME and MY_INSTANCE using #define statements, such as:
#define MY_HOSTNAME "esp32cam"
#define MY_INSTANCE "ESP32 Camera Demo"

2. Add a line to handle mDNS in the event_handler() function. This statement goes right after the switch() block, and before the final return statement.
mdns_handle_system_event(ctx, event);

3. Call the start_mdns_service() function before you initialize WiFi. For example:
start_mdns_service();
s_wifi_event_group = xEventGroupCreate();
.... followed by rest of statements to start WiFi...

You can then access the ESP32 module through the name esp32cam.local, for example. To stream video from the camera to a web browser, open
http://esp32cam.local/jpg_stream
in the browser.

Good luck tinkering!

Saturday, July 21, 2018

Think too much

My 3D printer had problems with its X-axis motor. The motor would stall sometimes. So I thought, could it be the VREF? Checked the VREF, it seemed acceptable. Adjusted it a bit, but still had stalls.

Could it be the stepper motor driver? Replaced it with a spare. Nope, still had stalls.

Could it be the motor itself? So I went on to replace the motor. And noticed that the cable connecting the motor to the board had a problem. One of the wires had broken off at the connector. That was the cause of the problem.

A broken wire.

Not VREF, not driver, not motor. Just a simple broken wire.

Note to self: don't think too much. Start troubleshooting from the basics. 😅

Friday, July 20, 2018

More World Heritage sites for Japan? Why?

Jomon Era sites picked for possible World Heritage designation

A Japanese tactic.

When World Heritage sites are sprinkled all over Japan, Japan cannot be attacked, because destroying World Heritage sites is a war crime.

And when you cannot be attacked, you usually become a bit bolder in the way you do things.

The human race has a long heritage, spread all over the world. Don't let World Heritage sites be unevenly distributed just because of a nation's proactiveness in seeking such recognition. It could be seeking recognition for other purposes than to preserve heritage.

Help with NK, or help NK?

Russia, China urge delay as US seeks to cut off oil to North Korea

I thought Trump said Putin is going to help with North Korea... not help North Korea.

So all that "being nice to Putin" play by Trump is still not delivering the results that he wants. I want to say, "Wake up America" but in this age of post-truth, I fear America is wide awake, and actually choose to continue along this path, to stick with the failure they have chosen because doing otherwise would be admitting their own failure.

Wednesday, July 18, 2018

The consistent inconsistency of Trump

Trump tries to calm political storm over Putin summit, says he misspoke

Of course he misspoke. He can never criticize a person when that person is in the room. He can only do it when they are not around.

The only thing consistent about Trump is that he wants people to like him. So he will say whatever it takes to get people to like him. He will criticize people to get his base to like him. Then, he will sing a different tune in front of those people he criticized so that they will like him. Such inconsistency based on his consistent need to be liked is his consistency.

Sunday, July 15, 2018

Improving based on customer feedback

As someone who got a 3D printer kit a few months ago, thinking to see what I can pick up about making and prototyping and such, it has been a learning experience. A steep learning curve, to build a 3D printer from scratch, knowing nothing about 3d printing, and having to try and learn details about both hardware and software aspects.

But it was worth the learning. It was time-consuming. But that's learning. You can't learn without using up time.

But I also cannot help but notice that as time goes by, products get better. I got a FLSun Cube at the start of the year. By mid of the year, FLSun was still selling the Cube, but the Cube has adopted a different design, using CoreXY as the driving mechanism, and switching to roller V-wheels instead of linear bearings.

Super. Great.

But I guess that is what this is all about. Things improve. I mean, if they don't, we would be extinct. Still, some form of versioning (Cube 1.0, Cube 2.0) would help when it comes to branding or corporate communication.

I digress. I actually wanted to share this video.


I was looking to get the Creality Ender-3 too, as a backup printer. And it seems that they have continued to improve it. Which is not a bad thing. But I was basing my decisions on reviews, which means that older reviews differed from newer ones as Creality made changes to the Ender-3... using paying customers as beta testers. Well, if you see it from "we listen to feedback from our customers", it may seem positive. But it may also sound a bit bordering on corporate ethics to use paying customers to help you improve a product without making it explicit that this is still a beta product.

On one hand, I think companies should do due diligence in R&D before selling a product. On the other, it is also important for companies to improve their products to better serve customers. A proper balance and method will help companies build up good reputations that serve them in the long run.

Friday, July 13, 2018

The exposure of the U.S.

My two-cents worth of thoughts...

I think with Trump being elected, and the on-going investigation on Trump's campaign, and the Republicans, being in power, doing what they are doing to "investigate the investigators," the facade that is the U.S. is being exposed for the world to see.

The U.S. used to stand for the rule of law. It used to be the champion for human rights, for democracy. It used to be the leader for free trade.

But all that is now the past.

Look at the "hearing" of Peter Strzok. It is not a hearing. It is a shouting match. It is personal attacks on a person instead of trying to uncover the truth. It is a humiliation to everything that the U.S. used to stand for. Decency has flown out of the window just so as to remain grasping onto power.

It shows that the U.S. of the past, the U.S. that we used to know, is no longer there.

It shows that the U.S. we had known in the past was but a show. People did not believe in what they were doing, but they were doing it because it was politically correct for what the U.S. is supposed to stand for. But with Trump, people are showing their true colors. Because he has shown that it is okay to show one's true colors and still be in power. Because there are many people out there in the U.S. who actually share those sentiments of racism, white supremacy, nationalism, unilateralism, of "might makes right." People can be themselves, and they are showing the world that the people of the U.S. are not the champions of democracy, rule of law, free trade, and human rights that we used to know them as. They were doing it, or bearing with it, because it seemed "right." And now, the wolves have thrown off their wool coats, because the shepherd has been replaced with a sheep killer.

It is an embarrassment. It is too indecent to watch. It is painful to see where the U.S. has fallen to.

It is the start of the decline.

When a great power declines (read The History of the Decline and Fall of the Roman Empire by Edward Gibbon), there are certain patterns. We were lucky that the British Empire handed over its dominance to the United States in a more pacified manner. But will the United States follow that same pacifist approach in its decline? Or will it go down lashing out, thrashing out, at all those around it? If the hearing of Peter Strzok is any example, it shows that the U.S. is likely to do everything it can, even if those things are below human decency, below dignity, to remain in power.

Monday, July 09, 2018

"Upgrading" may not be a good idea

I have a FLSun Cube 3D printer (2017 model) which was working... well, sort of fine. I mean, it prints okay, though it could be better. So I thought, why not use MGN12 rails for the X and Y axes, like someone else had? It should improve things, right?

Well, not for me. It turned out to give me more problems than I started with. I ended up with layer shift on Y-axis due to somehow the Y-motors stalling, even after increasing the VREF on the stepper drivers to account for the dual Y motors. In the end, I even burnt out two of my A4988 drivers... It was fortunate that the Cube came with 5 stepper drivers already installed (but only used 4: X, Y, Z, and E) and I had another which came with the dual extruder upgrade kit. Still, it prompted me to get some spares from Amazon. Who knows when the next driver will fail.

So after days of trying to fix my mechanical problems with the MGN12 rail "upgrade", I gave up. Took the upgrades apart, and started to fix back the original rods. Only problem... some of the rods are best put back in the correct order, as shown in the assembly manual. Removing them was easy; trying to put them back at the same position was not.

It was a big hassle with several hours spent trying to put everything back. And then, the next nightmare: bed leveling. Because the rods were a bit out, I had to tweak the bed leveling and rod positions endless times just to get something that resembles a printable surface. Which resulted in more hours lost.

After close to 20 hours spent just on putting everything back... I finally have a 3D printer that can print again. Phew.

But I also learnt some things along the way.

My Z lead screws, or one of them, was damaged. There is a long scar about 5cm long at one end (originally the top end) which prevented the bed from moving above a certain height. I didn't know why then; now I know. So I turned the rod around. Now the scar is sitting above the Z motor, and should not affect movements unless I am trying to do high prints (above 300mm).

There is a feature in Marlin known as manual mesh bed leveling. It is a mesh bed leveling method that is done manually instead of with a Z probe. This is something that I should try out since my Z probe triggers uneven over different parts of the bed.

I guess it wasn't a total waste of time if I learnt something, right? Or so I try to convince myself... 😄

Friday, July 06, 2018

Trump is meeting the Queen, and seeing the blimp

Trump to meet Queen Elizabeth despite chorus of discontent

So he is going to get to meet the Queen.

And see the nice Trump blimp they have over London too...

Didn't anyone tell him about the blimp? Well, I know no one wants to tell him news like that... but it is better than for him to be surprised when he actually sees it. Or maybe, he will actually like the blimp. "See? They love me, they even put a big balloon out just for me." 😄

Heavy rains in Japan

110,000 people in Kyoto ordered to evacuate after heavy rain in western Japan

Wow!

I think I better stock up on potato chips. At this rate, harvest may be hit again, like last year. Prices of vegetables are going to go through the roof again... 😟

But at least this area is not hit so badly. For that, I am thankful. It could be worse, like for those directly affected by the floods.

Tuesday, July 03, 2018

Standing up to Trump

Top U.S. business group assails Trump's handling of trade dispute

Finally, someone with the money has the sense to stand up. Of course, if they don't, they are going to lose money. So it only makes sense for them to try and put a stop to things before things get out of hand.

Yes, they want tax cuts. But they don't want trade wars.

Fair trade ≠ equal trade

While classical economics tries to simplify things (just look at the demand and supply curves intersecting to give price and quantity traded), things are not that simple in a real economy. There are various factors at play, with distribution of resources, economies of scale, workforce training, population size, product regulations, etc. which affects what and how goods move from one country to another. At the end of the day, the U.S. has been prospering under a system of fair trade, more open trade, which it has spearheaded in building over decades. Generations of Americans can't have been stupid and spearheaded a system which works against them; they spearheaded the system because it benefits them. And can still benefit them as long as they continue to work within the system.

I just hope it is not too late. And hopefully, the guy at the helms is not so thin-skinned that he refuses to back down from a disastrous road.

Still, if he refuses to back down, maybe this rich lot will buy enough Republicans to impeach him. After all, they have the money.