Category Archives: shopping

Podman and OpenCart

I have been doing some experiments with shopping cart systems, and was trying to run them on podman for some “quick” testing. (I’m not much of a container expert, but I don’t have a php setup on my workstation right now, so this seemed like a good time to become one)

Now, OpenCart installation instructions are super manual but that shouldn’t be too hard right?

Well, after a bit of faffing around, looking for an nginx+php-fpm container ready to go, I just fell back and tried:

$ podman run -p 8081:80 -d -v ./opencart-4.0.2.1/upload:/var/www/html php:8-apache

This runs ok, but you’ll instantly get problems trying to access it:

Warning: mkdir(): Permission denied in /var/www/html/system/storage/vendor/twig/twig/src/Cache/FilesystemCache.php on line 50
Warning: file_put_contents(/var/www/html/system/storage/logs/error.log): Failed to open stream: Permission denied in /var/www/html/system/library/log.php on line 34
Warning: file_put_contents(/var/www/html/system/storage/logs/error.log): Failed to open stream: Permission denied in /var/www/html/system/library/log.php on line 34RuntimeException: Unable to create the cache directory (/var/www/html/system/storage/cache/template/c3). in /var/www/html/system/storage/vendor/twig/twig/src/Cache/FilesystemCache.php on line 53

Ok… you are clever and wise, and have been around computers. You understand, in your bones, that podman’s rootless containers means that “apache” is really running as your normal user id, but thinks it has another id inside the container. You do a lot of reading about “podman unshare” but, you really don’t give a shit what fucking UID is being used inside the php apache container?! You finally find what sounds like the right solution, which sounds exactly right, but… not… quite?

$ podman run -p 8082:80 -d --userns=keep-id -v ./opencart-4.0.2.1/upload:/var/www/html php:8-apache
0e726377f1ecdf7120cdd74f9c9b89b424eba6602c01c167440da91e7069685a

$ podman logs -l
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.0.2.100. Set the 'ServerName' directive globally to suppress this message
(13)Permission denied: AH00072: make_sock: could not bind to address [::]:80
(13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs

Ok, this is because apache runs as root to bind port 80 inside the container, even though you’re always going to map it from the outside anyway, that sucks. Ok, one more bit of magic right? We can just tell the container that it’s allowed to bind to low ports!

podman run -p 8083:80 -d --userns=keep-id --sysctl net.ipv4.ip_unprivileged_port_start=0 -v ./opencart-4.0.2.1/upload:/var/www/html php:8-apache

And you finally get the OpenCart installation page at http://localhost:8083 None of this addresses the rest of the installation, like “removing the install folder once you’re done” and “configure mysql…”

More excessive customs and handling fees

Bought a somewhat fancy keyboard. (more on that later) Bought some custom made icelandic keys to go on it. Paid regular VAT on both. Bought some plastic inserts to help mount the new custom keys on the new keyboard. Got charged 7.5% customs. What? What is this duty for? It’s certainly not protecting any local industry. And it’s not to cover recycling of the parts or their packaging, there’s a separate charge for that. Still, only 7.5% still “not much” in the scheme of things. And then of course, the ever delightful hammer of icelandic online shopping, the flat rate 550kr “handling charge” of Iceland post. Effective net percentage on top for “fees”? 72.4% That’s unreasonable. I’m not complaining about VAT, (even though, because too many companies in europe don’t know how to take VAT off to send to Iceland, outside the EU, I’d already paid VAT in another country for this order) I’m complaining about the excessive handling charges with no alternative path. Good job Icelandic Customs, they legally allow “any” charge by the handler. Of course, I can’t control what shipping partner my parts are eventually delivered by, so I have no way of avoiding this. Iceland Post offers no way of preprocessing or providing more information to reduce or eliminate the charge either. It’s simply an impediment on trade, with no gains for anyone other than the postal service.20160630-customs-keyboard-parts-real

Protecting the domestic LED strip industry – Icelandic super taxes

Blah, another post about excessive import duties.  Boring, sure, but as heavy and obnoxious as always, and writing them all down gives me a nice record of them.

customs-super-tax-ledstrips

73% net import tax on 1480kr purchase price.

Bought a 1m strip of WS2812 led strip lighting.  $11.11, including shipping, or 1480 kr at today’s rates.  10% import duty, not sure why _this_ gets a duty charge, and not other electronics.  It can’t be an ewaste tariff, because none of the other electronics I’ve imported gets it, so I can only presume it’s protecting the nascent (non-existant) icelandic led strip manufacturing industry.  25% VSK,  Ok, expecting this, that’s just what VSK is.  and then the glorious 550kr fixed handling charge.  Some parcels get this, some don’t.  No way to control it, so no way to know in advance whether you should buy more on an order or not.  Hooray for consistency.

Total sum of charges: 550+386+146 = 1082 kr giving us an effective net import tax of just over 73%.  Excellent.  I love inconsistently applied regulations.

Icelandic post handling fees

I’m against being charged an arbitrary handling fee for receving a parcel. I’m fine with paying the customs + VAT charges, but I hate having to pay a flat fee for “handling” on top of that. But, if you’re doing it, it should at least be consistent. I got a parcel recently, and the invoice stuck on the outside of the parcel showed the split charge of VAT and handling properly.

Split fees for handling and customs

Split fees for handling and customs

You can see why I hate the flat fee here, it’s more than entire sum of VAT, resulting in an effective import tax of >50% instead of 25% (961 kr fees on a 1712 kr value parcel). It comes down far too heavily on small imports

However, the receipt I got from the post office after paying this has split it differently, claiming it was “free” to deliver it to me, and lumping all the rest into one line item.

"free" delivery, merged customs and handling fees

“free” delivery, merged customs and handling fees

This receipt is weird. Why would you have a line item for “delivery” being free, and then throw away the prior knowledge of this as two line items, and merge them into one? Silly post office.

Who pays for shipping? FedEx, TI and overseas agents

Update: I lost this in my drafts folder for over a year!

I live in Iceland. It’s a nice place to live, but it’s small, so I often have to buy things from overseas, particularly in for hobby electronics gear, but anything small and cheap has this problem.

Now, let’s get this straight, I’m not complaining about customs or VAT. (Not today anyway) VAT here in Iceland is 25.5%, and is applied at the end, on top of shipping charges. Customs rate isn’t always as easy to work out.

Now, in this example, I bought a device from Texas Instruments, for $US4.99, or about 630 ISK. This was advertised as shipping included, worldwide. Add 25.5% VAT, 790 ISK. Not bad. So it arrived yesterday.

Now, what does that even mean? They’ve charged me ~473 ISK for “customs handling” It doesn’t seem to be anything like the VAT rate, or the VAT rate plus the customs rate. (FIXME – finish getting customs rate)

Customs officially don’t collect anything like this, they simply say that agents are allowed to charge for filing paperwork.

So, this seems to be some arbitrary amount they just felt like charging. Next we have 750 ISK for being “an unregistered customer.” Well, that sounds awesome. I didn’t choose this company, I ordered a product from Texas Instruments with shipping included. Who knows if it’s even possible to become a registered customer.

Then there’s VAT on those charges. So, a whole 120% charge (of original purchase) on being the wrong sort of customer and another 75% (of original purchase) for “handling”. I can’t actually see where they charge the VAT/Customs on the product itself, but the end result is that I’ve paid 170% of the original purchase ON TOP of the basic vat rate + the product price. (1345 ISK + 790 ISK)

How is this remotely reasonable for “shipping included” ? And who’s responsible? Texas Instruments clearly believes they paid FedEx, (or presumably FedEx wouldn’t accept the shipment?) I can only assume that FedEx delivers the package to Iceland, believing that they’ve been paid, but I have zero insight into what the deal is between the local agent (Hraðflutningar ehf)

I believe the party responsible is IceTransport. As they said earlier, local customs agents, defined here, are allowed to charge basically whatever they like. So they do. I presume they treat customers shipping outbound through them quite a lot better, but what are my options at the end of the day? I refuse to pay their arbitrary charges, they hold the parcel, and they’ve already been paid by FedEx/Texas Instruments? So they bin the package, and are already in front? Or do I just suck it up, and pay through the nose? They’re both distasteful.

Customs official answer on handling charges:

http://www.tollur.is/displayer.asp?cat_id=2816&module_id=210&element_id=10177

802.15.4 export controls

Export controls. Woo, yeah! The USA classed various encryption as a weapon for a while, and tried to prevent it from being “exported” This was relaxed 10-15 years ago, when they realised how absurd it all was. Now, you can buy microelectronics with encryption built in, for instance, and what i’m talking about here, 802.15.4 transceivers have AES encryption built in. It’s a required part of 802.15.4 support after all. However, the way the export controls were relaxed required lots of paperwork, and there’s still some restrictions in place. And the big electronics distributors like digikey and mouser have interesting approaches to following these rules.

Here’s a quick roundup of what I tried to buy today on digikey. Note that all of these parts include AES encryption, as they are all 802.15.4 devices. In some cases, these aren’t even made in the US, they’re made in europe, shipped to distributers in the US, then not allowed out again because of these awesome “export controls”

Note: I live in Iceland, which seems to have fallen into a paperwork crack at some time, most of europe can buy these devices, but not me :(

Microchip’s MRF24J40 modules

Digikey will not sell the MRF24J40MA module by itself, DK partno: MRF24J40MA-I/RM-ND
Digikey will sell the ZENA usb dongle, which is a MRF24J40 radio + USB interface, DK partno: AC182015-1-ND

Mouser will sell the modules.

Farnell said they would sell the modules, then asked me to fill out export restrictions forms (from the UK, not the US!) and has since not replied. (This was about 6 months ago)

ST’s STM32W parts

Digikey will not sell me the STM32W-RFCKIT, DK partno: 497-11406-ND
Digikey will sell me the STEVAL-IDZ401V1, an STM32W based USB dongle. DK partno: 497-12887-ND

Mouser wouldn’t sell me the STM32W-RFCKIT either

TI’s CC2531 parts

Digikey will sell me the TI CC2531 usb dongle, DK partno: 296-28921-ND
Digikey will also sell me CC2531 chips themselves

Freescale’s MC1322x parts

Digikey will not sell me the usb dongle, DK partno: 1322XUSB-ND
I didn’t try buying the parts themselves

Atmel’s range

Digikey will sell me the Raven RZ USB stick, DK partno: ATAVRRZUSBSTICK-ND
Digikey will not sell me the development kit, DK partno: ATAVR128RFA1-EK1-ND

So, awesome job there. I can still buy “restricted” encryption hardware, but only some of it, and only in certain shapes. Fucking ballsup. I’ve spoken to Digikey, (though not with such a list of contradictions) and they brushed me off with, “we just follow the export restrictions guidance from the DOJ” They might bend a bit more if I was ordering 10k units of course, and actually go and check the paperwork, but that’s no help for me today.

Vodafone 845 review. (Huawei 8120/Huawei Joy)

I needed a new phone, my old sony ericsson G502 had been misbehaving for months, (rebooting whenever it received a phone call or an SMS) I had been hoping to hold off on a new phone for another six months or so, to let the newer android phones trickle down a bit in price. I’m not really big on buying super expensive phones. I’d been burnt before, buying a “high end” phone that was good on paper, but had a terribly clunky interface, poorly integrated, or just unreliable physically.

So, the phone. It’s nice and cheap, runs android 2.1. I paid a touch over 20k ISK (about 120 €) which makes it a nice midrange phone, the sort I’ve become happy with. (After also being burnt by super low end phones that also had software problems) You can read the boring paper specs elsewhere. It works I guess. The GPS works very well, great reception, but it will suck your battery dry in a couple of hours. (At least, using Maverick (light) to actually record a track and so on)

It has a resistive touchscreen. This is actually fine. It’s not the super light feather touch of an iphone, but it works just fine. It does take a bit of getting used to, after having a standard regular button phone for years and years. The predictive text is excellent, doing a good job of learning. The autocorrect is also excellent. You can have three keyboards, one qwerty style, with one letter per button, one phone style, with three letters per button, and what I’m told is blackberry style, with two letters per button. I prefer the qwerty style, but sometimes the fat fingers hit a neighbouring button, and the autocorrect does a really great job of working around it.

I have not yet found out how to enter icelandic letters, which means that it’s surely possible, but it wasn’t thought out well enough, especially not for a phone sold in Iceland.

The barcode scanner, or probably more correctly, the camera on the phone, isn’t capable of dealing with regular “2D” barcodes, it can’t focus well enough up close, though it does ok with medium and larger QR codes. (Again, small QR codes are just too small for it)

The camera white balance is pretty good, arguably better than my canon, but canon is notorious for auto white balance being warm yellow under incandescent lights anyway. The shutton button is a soft button, so I sometimes find it hard to keep the camera still enough while taking a picture. I don’t really use the camera much though, as I carry a “proper” camera with me all the time anyway.

The microSD slot is only accessible by taking the back off the phone. And android, for god knows what reason, at least in version 2.1, makes it more difficult than it should to access the card over wifi.

The wifi works just fine, no problems there. Again, it eats battery. With wifi turned on, you’ll get a day, tops. With wifi off, or only on when it’s being used, you can easily get a few days.

It has recently (it’s nearly two months old) decided to “snooze” forever. I liked the fact that I could change the snooze time for the alarm clock, but recently, I press snooze, and instead of being woken again in 5 minutes, I wake up two hours later, the phone says the alarm is “snoozing” but it hasn’t rung again. This is a rather serious failure.

The phone sometimes, (4 times or more, far far too often) decides that it simply can’t see any network service. (This is not like americans complaining about AT&T’s GSM network, this is downtown Reykjavik, where phones just work. I’ve never had a phone complain about no service in town) The phone just sits there with an X on the service bars, saying no service. Every 5-10 minutes, it power cycles the radio? and I get that awesome buzzing in the speakers (like when you’re just about to get an SMS?) and it will see network service for a minute or two before dying again. This _sucks_ battery. I was late to work one day when the phone ran out of battery over night. I’ve only been able to fix this by taking the sim card out and putting it back in again.

The phone has a “drag to unlock” screen, but seems to unlock itself in my pocket, and do really helpful things like make phone calls to recently called people. Why it always makes phone calls, instead of starting some other app, or the camera, or anything else, I don’t know. This is also annoying.

Is it a terrible phone? hmm, hard to say, the random calling people is pretty crap, but at least the other ones I can (somewhat) control. On my old Sony Ericsson G502, I simply had no control. The phone might or might not reboot if I tried to use it. On my older Nokia 1200, I could send SMSs, but they might not actually get sent. (Known issue with that phone, pity, it’s an otherwise _excellent_ phone, superb battery life, simple, compact, rugged, includes a torch, and super cheap) The alarm clock issue is new, and also rather annoying. Being able to comfortably use web things on the phone is nice though. It was also (relatively) cheap, so I don’t feel particularly burnt. (The same money would get me yet another generic sony ericsson, or nokia, with no particular features whatsoever, and both those companies have been going downhill software and reliability wise)

I could go on and on and on and on, talking about things I like and don’t like, but really, who’s going to read all this anyway?

Summary: It’s got problems, which might become total failure problems, but none of them are to do with the resistive touchscreen or the slower processor, which is all you will hear about in any other reviews of this phone.

Packaging samples and small orders: Sensiron

Following on from yesterday’s post about Microchip’s samples packaging, today we have Sensiron. No handling charges, so no risk of any VAT charges from customs nazis here. And delightfully, the samples came just in a regular business envelope, inside a little sleeve of bubble wrap. This was just happily posted through the letterbox like any other mail, instead of being held by the aforementioned customs nazis for a few days while they searched for a receipt to bill VAT from. WIN!

Sensiron samples packaging - 1xDFN6

Sensiron samples packaging - 1xDFN6

Packaging samples and small orders: Microchip

I’ve gotten a few samples from various companies over the years, or in various cases, bought a couple of parts direct from the manufacturer. It often amuses me the huge differences in packaging levels between the various manufacturers. I’ve got a few things recently, while looking for some particular parts, so I thought I’d run a short series on how some companies stack up.

Microchip sent me four SOT23 devices in this nice small cardboard box below. This is fine, and I might even find a use for the box again, but because it came in a box, customs here in Iceland held it up for a few days searching for a receipt. (first from me, and then inside the parcel when I couldn’t provide one) On the bright side, the parts list inside the box didn’t list the “handling” charge they charge for all samples, so customs didn’t try and charge me VAT. Small miracles :)

A simple envelope with maybe a sleeve of bubbles would have been plenty, but this is fine really. Nothing to complain about :)

Microchip samples package - 4xSOT23

Microchip samples package - 4xSOT23

Adafruit shipping prices, part 2. Or, tipping and fuel surcharges.

If you don’t want to read an overly analytical piece on shipping and online carts, just skip this altogether.

So, this morning I woke up to find adafruit had found my somewhat disparaging remarks within an hour of me posting them, and seemed rather concerned that I retract/change my wording, because they never pad prices.  I commented that there’s nothing intrinsically wrong with it, it’s quite a common practice, it’s just something I don’t particularly like.  I’d rather see the product price reflect the price you need to get to stay in business, and shipping being shipping, and nothing more.  The net price might be the same, but I just feel better about it that way.

I played with their cart again before I left for work, and found that every item is at least 0.1 pounds (45g), and there’s no scaling of that as you go up.  Some things count as 0.2 pounds.  I completely endorse minimum weights.  These are handpacked kits, and there’s a lot more to a kit than just the sum of the parts on mouser/digikey.  But, if I order 1 magnet, it’s 0.1 pound. 2, 0.2 pounds, 4, 0.4 pounds.  If I order 40, my order is calculated as weighing 4 pounds.  This is clearly wildly inaccurate, and rather than converging as the number of items goes up, it just stays flat.  Ramping out with ever increasing error.

You can pick any item.  An xbee adapter kit, weighing in at 12g packed, actually counts as 0.2 pounds, or 90g.  So with 5 of them in the cart, we’re going to get billed for a whole pound, and the shipped weight will only be 50g or about 0.1 pounds, plus the packaging.  If you look at the shipping estimates, you’ll see that adafruit calculate their packaging to be 0.2 pounds.  This is entirely reasonable, and sensible of them to add on for packaging.

Which leads back to my first post yesterday.  I got charged for 1.6 pounds shipping.  Which, although not super cheap, is reasonable, given the difficulty in locating some of these parts elsewhere.  But, clearly, my order didn’t weigh that much. It simply couldn’t have!  Adafruit claimed in their comments yesterday that they weigh every parcel before it goes out, and while that’s absolutely true, as they need to weigh it to work out how much they’re paying in shipping, I’ve already paid for shipping by that point, based on what the shopping cart calculator decided.  See the picture of the packaging, where adafruit only paid for 6 ounces, not 1.6 pounds that they charged me.  Note, this is _not_ a clerical error, with an extra decimal point or anything, 0.6 pounds is over 9 ounces.

I’m quite happy to believe that adafruit had no intention of price padding, but if I pay for 1.6 pounds of shipping, and the merchant only pays for 6 ounces of shipping, well, I call that price padding. I really do believe they probably had no intention of doing this, nor even knew they were.  They’re far too active in community outreach and education to be knowingly doing this, but I pointed this out this morning, and have had no further comment from them, other than “am I going to update the post / title”

And now some pictures