Hands On Internet of Things with Blynk Build on the Power of Blynk to Configure Smart Devices and Build Exciting IoT Projects 1st Edition Pradeeka Seneviratne instant download
Hands On Internet of Things with Blynk Build on the Power of Blynk to Configure Smart Devices and Build Exciting IoT Projects 1st Edition Pradeeka Seneviratne instant download
https://ebookmeta.com/product/stm32-iot-projects-for-beginners-a-
hands-on-guide-to-connecting-sensors-programming-embedded-
systems-build-iot-devices-with-stm32-1st-edition-aharen-san/
https://ebookmeta.com/product/internet-of-things-theory-and-
practice-build-smarter-projects-to-explore-the-iot-architecture-
and-applications-amit-kumar-tyagi/
https://ebookmeta.com/product/beginning-micropython-with-the-
raspberry-pi-pico-build-electronics-and-iot-projects-1st-edition-
charles-bell/
https://ebookmeta.com/product/conjunctive-explanations-in-
science-and-religion-1st-edition-diarmid-a-finnegan/
Phytochemicals in Food and Health Perspectives for
Research and Technological Development 1st Edition
Mamta Thakur
https://ebookmeta.com/product/phytochemicals-in-food-and-health-
perspectives-for-research-and-technological-development-1st-
edition-mamta-thakur/
https://ebookmeta.com/product/princeton-review-ap-u-s-history-
prep-college-test-preparation-23rd-edition-the-princeton-review/
https://ebookmeta.com/product/my-revision-notes-aqa-
gcse-9-1-business-malcolm-surridge/
https://ebookmeta.com/product/europeanisation-good-governance-
and-corruption-in-the-public-sector-the-case-of-turkey-1st-
edition-digdem-soyaltin/
https://ebookmeta.com/product/reflect-relate-an-introduction-to-
interpersonal-communication-5th-edition-steven-mccornack/
Fundamentals of Causal Inference with R 1st Edition
Babette A. Brumback
https://ebookmeta.com/product/fundamentals-of-causal-inference-
with-r-1st-edition-babette-a-brumback/
Hands-On Internet of Things with Blynk
Pradeeka Seneviratne
BIRMINGHAM - MUMBAI
Hands-On Internet of Things
with Blynk
Copyright © 2018 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or
transmitted in any form or by any means, without the prior written permission of the
publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the
information presented. However, the information contained in this book is sold without
warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers
and distributors, will be held liable for any damages caused or alleged to have been caused
directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
ISBN 978-1-78899-506-1
www.packtpub.com
mapt.io
Mapt is an online digital library that gives you full access to over
5,000 books and videos, as well as industry leading tools to help you
plan your personal development and advance your career. For more
information, please visit our website.
Why subscribe?
Spend less time learning and more time coding with practical
eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
The first part of this book offers how to set up the development
environment with Raspberry Pi, Raspbian Stretch LITE, and various
software components. Then, the reader will build the first IoT
application with Blynk.
The middle part of the book presents how to use and configure
various widgets (control, display, and notify) with Blynk app builder
to build applications.
The latter part of the book will introduce how to connect with and
use built-in sensors on mobile devices such as Android and iOS. After
this, the reader will learn how to set up a personal Blynk server on
Raspberry Pi. Finally, the reader will learn how to build a robot
vehicle that can be controlled with a Blynk app through the Blynk
cloud service.
Who this book is for
This book is for those who want to build rapid IoT applications in
minutes for connected products and services with only a basic
understanding of electronics, Raspberry Pi, and C++.
What this book covers
Chapter 1, Setting Up a Development Environment, explains how
to set up the development environment for Blynk with Raspberry Pi.
It describes how to install Blynk libraries and some supporting
software components that you can use to build Raspberry Pi-based
IoT hardware. Then, you will build a control application with Blynk
app builder. After that, you need to write a C++ application to
connect with the Blynk cloud. Finally, you run the Blynk app to
connect the Raspberry Pi to Blynk app builder through the Blynk
cloud over a Wi-Fi network.
Once the file is downloaded, please make sure that you unzip or
extract the folder using the latest version of:
Piracy: If you come across any illegal copies of our works in any
form on the Internet, we would be grateful if you would provide us
with the location address or website name. Please contact us at
[email protected] with a link to the material.
You can read the list of up-to-date hardware that you can use with
Blynk at
https://github.com/blynkkk/blynkkk.github.io/blob
/master/SupportedHardware.md.
Connection types
Blynk supports the following connection types to connect your
microcontroller board (hardware) with the Blynk Cloud and Blynk's
personal server:
Ethernet
Wi-Fi
Bluetooth
Cellular
Serial
However, throughout this book, you will only focus on Wi-Fi and
Ethernet connection types to connect with Blynk Cloud and Blynk's
personal server.
Blynk architecture
The Blynk platform includes the following components:
Blynk app builder: Allows to you build apps for your projects
using various widgets. It is available for Android and iOS
platforms.
Blynk server: Responsible for all the communications between
your mobile device that's running the Blynk app and the
hardware. You can use the Blynk Cloud or run your private
Blynk server locally. It's open source, could easily handle
thousands of devices, and can even be launched on a Raspberry
Pi.
Blynk libraries: Enables communication with the server and
processes all the incoming and outcoming commands from your
Blynk app and the hardware. They are available for all the
popular hardware platforms.
If you want to build an app with Blynk for business purposes, visit
http://www.blynk.io/business/ for more information:
Blynk widget Box
Installing the Blynk app
builder
The Blynk app builder is currently available for Android and iOS
platforms. The following steps explain how to install the Blynk app
builder on your Android smartphone or tablet:
1. Tap the apps icon in the lower-right corner of the home screen
(consider that this is the default location).
2. Swipe left and right until you find the Play Store icon.
3. Tap the Play Store icon.
4. The first time you open the Play Store, you may be prompted to
sign in with your Google credentials. If you still don't have a
Google account, you can create a free account with Google.
5. Once you sign in with Google Play Store, you can search for a
specific app.
6. Tap the magnifying glass in the upper-right corner, type in the
name blynk, and tap the magnifying glass on the keyboard to
execute the search. You will get a result on the screen as
follows:
Search results for Blynk
7. Tap INSTALL to start the installation process. Also, you can find
more information about the app by tapping the MORE INFO
button:
Installing Blynk app
CHASED BY A TIGER.
"In a few minutes I heard the growl of a tiger, who was in full pursuit, and
gaining at every stride. The road led to a creek, and it occurred to me that my
whole safety consisted in reaching that creek before the tiger reached me. I
threw my hat off to amuse the beast for a moment, and it gave my horse just
the time he needed without a second to spare. The tiger did not try to follow
through the water, and when I got to the house where I was to stay, I
resolved not to venture again on that road after dark.
"Some of my friends were unkind enough to say that perhaps I was mistaken
in the whole matter, and that the horse took fright at a thorn catching under
the saddle-girth as we went through the jungle; so the next morning I invited
one of them to go with me to the creek, and to the spot where I threw away
my hat. The fragments of the hat were there, where the tiger had torn it in
his rage, and the tracks of the beast were visible in the soft earth. From the
extent of his foot-prints he was evidently of the largest size, and would have
made short work of a man when once he had settled his teeth into his throat.
It was the narrowest escape I ever had in my life. I have been treed by a
bear, but the sensation was nothing compared to that of being chased by a
tiger."
"Please tell us," said Fred, "how you happened to be treed by a bear."
"Certainly," said the gentleman; "but the story has nothing to do with Sumatra
or any other island of the Malay Archipelago. It was in America that the
incident happened.
"I was out hunting one afternoon, and had only a small fowling-piece loaded
with bird-shot. Suddenly I came across a black bear, and very foolishly fired at
him. The shot enraged him, and he ran for me.
"I ran a few yards, and knew that every moment he
was gaining on me. I dropped my gun, and sprung
for the nearest tree; I was young and active, and
went up several feet at the first bound. It was a
smooth sapling, with the lower part quite free from
limbs, and I soon found that it was no easy matter
to climb after the first spurt was over. The bear
followed me, and had the advantage of claws; and
he came on faster than was agreeable. I knew that
a friend of mine was not far off, and I shouted with
all the power of my lungs. He heard me, and came
to my relief; and, just as the bear had taken me by
the coat-tail, I heard a shot, and the beast tumbled
to the ground. I don't like bear-hunting in that
shape."
Fred inquired if there were any snakes in Sumatra.
"Yes, snakes in abundance," was the response;
TREED BY A BEAR. "and they sometimes grow to an enormous size. In
some respects, Sumatra is the paradise of snakes,
as they have a hot climate, and can always find plenty to eat."
"What kind of snakes do they have there?" queried Fred.
"The largest is the boa-constrictor," said the gentleman; "and I do not believe
he grows to a greater size in any other part of the world."
"What is the greatest length you have ever known for one of these snakes?"
Frank asked.
"The longest I ever saw was one that I killed myself. I was out hunting, and
had three or four natives to carry my gun and other things, when suddenly
one of them shouted, and pointed to a tree.
"I looked, and saw an enormous snake coiled up there, with his head over a
limb, and evidently watching us as we approached.
"Du Chaillu and other hunters of experience say that the best thing for
shooting a snake is not a bullet, but a charge of small shot, such as we use in
duck-hunting. So I gave my rifle to one of the natives, and called for my
fowling-piece.
SHOOTING A BOA-CONSTRICTOR.
"I managed to get around in order to have a good aim, and ventured so close
to the snake that the natives warned me to be careful. I watched my chance,
and just as the fellow darted his head forward I fired.
"My aim was accurate, and the snake's head was blown into a shapeless
mass. He threw himself from the tree, and writhed on the ground, while I
retired with my party to a safe distance. We watched him twisting his body
into many shapes, and tearing up the small trees and bushes as he wound
around them. In about an hour I continued my hunt, leaving one of the
natives to watch the snake, so that we could skin him when he was done
writhing.
A SNAKY CREEK.
"Wishing to explore a small creek, I sent another of the men to bring a boat;
and he soon returned with it. It must have been a great day for snakes, as we
had not gone far before the water seemed to be alive with them. They were
of all the colors of the rainbow; and some of them had shades that the
rainbow never possessed. The largest I should judge to have been eight or
ten feet in length, but I had no opportunity to measure him.
"One tried to get into the boat, and I shot him just as he raised his head over
the bow; others swum close to the boat, and seemed in no hurry to get out of
our way. There was a large boa, or python, coiled around a tree that
overhung a bank; he darted his head rather defiantly, but made no other
demonstration. I was quite willing to let him alone, provided he would be
equally polite to me; and, as he manifested no intention of attacking us, I did
not fire on him.
"We went back late in the afternoon, and found that our great boa had
ceased his twistings, and was sufficiently quiet to be skinned. He measured
thirty feet and a few inches in length, and was certainly one of the largest of
his kind. He could kill and eat an ordinary-sized cow or bullock; and, as for a
dog or monkey, he would dispose of one without the slightest trouble. The
favorite food of this snake is the monkey; and he captures him by lying
concealed among the trees, and waiting patiently till the monkey comes
within his reach."
MONKEY EXAMINING A TORTOISE.
"Then there are monkeys in Sumatra?" said one of the boys.
"Certainly," was the reply, "there are monkeys in abundance. The naturalists
have found no less than eleven distinct species of the monkey family, and it is
thought there are several yet undiscovered in the forests. There is one
monkey called the simiang, that has tremendously long arms; Mr. Wallace
measured one that was only three feet high, but his arms were five and a half
feet when stretched out. This monkey will swing himself from one tree to
another with the utmost ease, over distances that most of the other monkeys
would hardly venture to go."
"Do they find the variety of monkey known as the orang-outang in Sumatra?"
one of the boys asked.
"Yes," said their informer, "the animal is found only in Sumatra and Borneo,
but he is rarely seen on the first-named island. In parts of Borneo he is quite
abundant; and the most of the specimens in the museums all over the world
came from that wild region."
Frank asked how large was the largest of these beasts that had been captured
and measured.
FEMALE ORANG-OUTANG.
(From a Photograph.)
"As to that," said the gentleman, "there is a considerable conflict of testimony.
Mr. Wallace says that the largest killed by him during his stay in Borneo was
four feet two inches from head to heel; and his outstretched arms were seven
feet nine inches from tip to tip of his fingers. The face was thirteen inches
wide, and the body measured forty-three inches around. Mr. Wallace further
says that he measured seventeen freshly-killed orangs, and the skeletons of
two others; sixteen were full-grown adults—nine males and seven females.
The males varied from four feet one inch to four feet two inches in height;
and the outstretched arms from seven feet two inches to seven feet eight
inches. The measurements of other naturalists closely agree with his, and he
therefore concludes that the stories of orangs exceeding five feet in height are
extremely doubtful.
NATIVES OF BORNEO FIGHTING
WITH AN ORANG-OUTANG.
"The natives say the orang is king of the forest, and the only animals that
venture to attack it are the crocodile and the python. They only do so on rare
occasions, and are apt to get the worst of the battle whenever they provoke
it. One of the native chiefs says that when food is scarce in the forest, the
orang goes to the banks of the streams to feed on the lilies, and in such cases
he is sometimes attacked by the crocodile. His arms are so strong that he has
been known to pull the crocodile's jaws open, and rip up his throat; the chief
claims to have witnessed such a fight, which occurred on the bank of a
stream, and was won in a short time by the orang.
"The same chief said that the python found his match in the orang—the latter
biting the python's throat, and tearing him with his powerful claws. The
natives have a great dread of the orang, unless they have the advantage of
fire-arms; they sometimes attack him with their spears and hatchets, but they
do so with reluctance, as some of them are apt to be severely wounded, if not
killed outright in the encounter."
Fred wanted to know if the animal they were discussing was in the habit of
walking erect like a man, as he had seen represented in pictures.
"The best authorities say he does not," was the reply; "and I think that such
pictures as you mention are far more imaginary than real. He spends nearly
all his time in the trees, and when he goes through the forest he moves from
one tree to another by following the limbs that interlace. He feeds in the trees
in the daytime, and sleeps there at night; his bed is composed of leaves
gathered together in the fork of a tree, and he never remains long in one
spot. The natives say he finds a new resting-place and makes a new bed
every night; but there is some doubt as to the correctness of this theory.
When he has been wounded, and feels faint from loss of blood, he will gather
a quantity of leaves and form a bed, where he lies down and dies. In such a
case the tree must be cut down to get his body, as no amount of shaking will
dislodge it; or the natives must be hired to climb up and remove it. This they
will not do readily, as the animal has great vitality, and has been known to
spring up suddenly and do a great deal of damage after he was supposed to
be dead."
"There are some other curious products of this tropical region," said the
narrator, "which I will endeavor to describe briefly. There is a frog that flies
through the air, and—"
"How funny!" Fred exclaimed. "A flying-frog! He ought to be a relative of the
fish that climbs a tree, and travels on dry land."
A FLYING-FROG.
"Whether he is a relative or not of that fish, I am unable to say," was the
reply, "but that he exists there is no doubt. He comes down from the top of a
high tree to the ground in a slanting direction, just as you have seen a flying-
squirrel go from one tree to another. His toes are very long, and webbed to
their extremities. The body of the frog is about four inches long, and when
spread out the webs of his feet have a square surface of at least twelve
inches. This is much more than he needs for swimming, and we must,
therefore, conclude that Nature has thus equipped him so that he can fly
through the air.
"There are many varieties of butterflies in Sumatra, and some of them are
very beautiful. All the tropical islands abound in butterflies, that arouse the
enthusiasm of the naturalist by the brilliancy of their colors and the great size
they attain. There are numerous birds, especially of the parrot family, and
sometimes you will see hundreds of them in a walk of an hour or more
through the forests where they live. The parrot is inclined to be sociable, and
likes his fellow-parrots; you will rarely see one of these birds quite alone, and
when you do, you may conclude that the occurrence is an accidental one.
"Among the habits of birds there is none more singular than that of the
Sumatran hornbill."
"What is that?" Frank inquired.
"The hornbill, whose scientific name is Buceros bicornis, makes its nest in a
hole in a tree. When the female has laid an egg, the male plasters up the
entrance of the hole with mud, and keeps his mate there until the young bird
has been reared to the proper age for coming out in the world."
"How does she manage to live all that time?" said one of the boys.
"The hole is not entirely closed," was the reply. "A small opening is left, and
through it the male bird feeds her, and he is constantly on duty around the
outside of the nest to protect her from harm. When the young bird begins to
eat, the mother takes in her beak the food which her mate has brought, and
gives the youth his proper allowance. He is a funny-looking fellow when about
half grown; his body is plump and soft, without a single feather, and his skin
is half transparent, so that you almost expect to see through it."
"A remarkable bird," said Fred.
"And a remarkable country he lives in," Frank replied.
And with this comment the conversation about Sumatra and its products came
to an end, with a vote of thanks on the part of the boys to their amiable
informant.
A SUMATRAN BUTTERFLY.
CHAPTER XXV.
ARRIVAL IN JAVA.—SIGHTS AND SCENES IN
BATAVIA.
At daylight the next morning the boys were on deck for their first sight of
Java. They could see nothing but a low coast, like that of Siam, with a fringe
of tropical trees, and a backing of mountains in the distance. They had
expected to go into a snug harbor, but found that the harbor of Batavia is
more imaginary than real, as it is little better than a shallow roadstead, where
ships of deep draught must anchor far from shore.
The steamer came to her resting-place, and the anchor went plunging down
to its muddy bed. A noisy little steam-launch came to carry the mails ashore,
but our friends were not allowed to take passage in her; they were told there
would be a steamer for the passengers in an hour or two, or, if they preferred,
they could go ashore on a native boat.
They chose the latter conveyance, as the time of waiting for the steamboat
was a trifle uncertain; and, besides, they desired to get to land as speedily as
possible. There were a dozen boats hovering around the steamer, and it did
not take long to make a bargain; for three florins—a Dutch florin is equal to
forty cents of our money—they were to be carried to the "Boom," or custom-
house, where their baggage would be examined, and they could find
conveyance to the hotel. As soon as the bargain was made their baggage was
lowered into the boat, and they were off.
It was a long pull, and the sun was hot. Our friends reclined under their
umbrellas, and tried to be comfortable; and the boys wondered how the
boatmen could pull away so cheerily and not be fatigued. The Doctor
reminded them that the men had been accustomed all their lives to the
climate of Java; and what seemed very severe to strangers from the North
was nothing to those who were used to it. The men evidently understood the
subject of conversation, as they offered to pull twice as fast for another florin;
their proposal was declined, as none of the newcomers wished to be the
cause, however indirectly, of a sunstroke among the natives.
ARRIVAL IN PORT.
It was a journey of three miles from the steamer to the custom-house, partly
in the harbor and partly in a canal. The canal is pushed out a considerable
distance into the harbor by means of stone dikes; and the space between
these dikes is dredged to a depth of twelve or fourteen feet. Nothing but
small craft can come up to the docks; heavy sea-going ships, whether steam
or sail, must anchor in the harbor, and their cargoes are transferred by
lighters.
As soon as they reached the end of the wall that forms the canal the boatmen
drew up against it, and for the rest of the way the boat was towed, or
"trecked." This mode of propulsion was easier and faster than rowing, and
partly accounted for the proposal of the boatmen to double their speed, as
they were near the end of their rowing when they suggested it. At the
custom-house the trunks and valises were subjected to a slight examination;
there was a polite official who spoke English; and on learning that our friends
had only come for a brief visit to Java, and had no business to transact, he
assured them that all was right. He asked for their passports, and said it
would be necessary to get a permit to remain on the island, especially if they
wished to travel in the interior. This they could easily do, he said, through
their consul; and then he informed them that the formalities of the custom-
house were ended.
THE CARRIAGE AT THE
CUSTOM-HOUSE.
A runner was there from the hotel they intended to patronize, and so they
gave their property into his hands. It was piled on a cart and sent off, and
then the runner led the way to a carriage that was standing near. It was a
sort of Victoria, that could accommodate two persons comfortably; and there
was an extra seat just behind the driver, which could be turned down and
made to hold a third passenger in an emergency. The horses were diminutive
beasts, with harnesses in the European style; and the driver was a withered
specimen of a Javanese, wearing an ancient hat decorated with a cockade,
and having the brim turned so that it would not impede the view in any
direction. Fred thought the hat had come from Holland about the middle of
the century, after doing duty in a respectable family of Amsterdam for at least
a dozen years. Frank remarked that the hat was hardly less antique than the
head it covered; and the skin of the one seemed as much glazed as the other.
THE NATIONAL TASTE.
It was nearly, if not quite, three miles from the custom-house to the hotel,
and the little horses went over the ground at a surprising rate, when their size
and appearance were considered. For much of the way the drive followed the
bank of a canal, where they saw groups of men and women engaged in
washing clothes or taking a morning bath. Batavia is on level ground, the
same as Amsterdam; and the Dutch have tried to make it seem as much like
home as possible by supplying it with canals. They have carried many of their
customs with them in emigrating to the East, and sometimes to their
disadvantage. For instance, they adhere with unflinching firmness to the old
practice of taking a glass of schnapps before every meal, forgetting that what
may be allowable in a cold country is the reverse of beneficial in a hot one.
Our friends reached the hotel a little while before the mid-day meal was
served, and they were hardly inside the door of their rooms before a servant
came with glasses of a fiery liquid to enable them to get up an appetite. He
was somewhat surprised when they declined what was considered so
necessary to the health.
The hotel covered an immense area, as it consisted of a series of bungalows
of one story, with a central building, where the dining-room and the offices of
the manager were located. Between the rows of bungalows there were shade-
trees and paved walks, and along the front of each house there was a wide
veranda, where the occupants could sit or recline in the open air whenever
they chose to do so. The central building was two stories high; all the lower
part was taken up for the dining-room and parlors, while the upper floor was
occupied by patrons. Our friends were assigned to rooms in one of the
bungalows, and a barefooted servant came to assist them in arranging their
effects, and bring whatever they desired.
The servant was of a type new to our friends, and
Frank proceeded to make a sketch of him at the first
opportunity. He was a Javanese Malay, with features
not unlike those of the Malays of Singapore, but his
dress was different. He wore trousers of striped
cotton, rather narrow in the legs, and without any
nicety of fit; above the trousers he had a gaudy
shirt, with an embroidered front, and a short jacket
of material similar to that of the trousers. Wrapped
around his waist, and falling to the knee, he had a
skirt that appeared to have been cut from the gayest
piece of calico that ever came from the looms of
Manchester or Lowell; and it was held in place by a
belt. This part of the Malay wardrobe is called a
THEIR SERVANT.
sarong, and is worn by both sexes; it is usually
fastened by tying a knot in one corner, and then
drawing the sarong tightly around the waist. The knot is passed under the
straightened edge of the garment, and is not likely to slip out of place.
Accompanying this servant there was a small boy whose business it was to
bring cigars, and fire for lighting them. It seemed to Frank and Fred that the
Dutchmen of Batavia were smoking all the time; and Fred suggested that, if
the days were as long, there would be exactly as much smoking.
Breakfast was served in the room we have mentioned, and Doctor Bronson
and the boys were shown to the seats assigned to them. Frank made a
discovery that amused him greatly, and was equally entertaining to his cousin
when he learned of it. It was so unlike the custom of any hotel he had ever
seen, that he made a note of it to include in his next letter. Here it is:
"The three of us have one servant; and, as far as I can see, he waits on no
one else. In each of our rooms there is a little closet, and in this closet there
are knives, forks, spoons, plates, etc., for one person. Before breakfast or
dinner our servant takes these things to the general table, and when the meal
is over he brings them back again, and returns them to their places in the
closets. He is responsible for breakage, and is required to keep the articles
clean. The only dishes that go to the kitchen of the hotel are the platters,
tureens, and similar things, on which the food is brought from the place of
cooking."
Fred was busy with his eyes and ears during breakfast, and contributed to the
general fund of information as follows:
"The first solid meal of the day in Batavia is called the rys-taffel, or rice-table.
It is served about eleven o'clock; and its name goes far to describe its
character, as it consists largely of rice. This is the way they serve it:
"The rice is boiled in such a way that each grain is separate from every other.
It is served hot in a large dish, and you help yourself into a soup-plate of
goodly size.
THE
MANGO.
"One servant hands you the rice, and when you have filled your plate with it
another servant offers you a round platter or tray, eighteen or twenty inches
across, and divided into a dozen compartments. These compartments contain
various seasonings, and you may take any or all, or none of them, at your
pleasure, and in quantities to suit you. You have chutney, which is a sharp
sauce from India; you have red or green peppers, cut into a fine hash, red
pepper mixed with water to form a paste, cocoa-nut grated fine, preserved
ginger-root, sliced mangoes, English pickles, salt fish dried to a crisp, capers,
and other hot and spicy things peculiar to the East.
"When you have taken what you want from the tray, the servant moves on,
and another takes his place. He offers you soft eggs, either boiled or poached,
and you are expected to take one or two of the eggs to mix with your rice.
Then comes a servant with a plate of some kind of meat, cut into small
pieces, and stewed with curry-powder; and behind him is another servant
with a plate of some kind of vegetable, which has been stewed in curry. Then
they offer you cold chicken or ham, or some other meat, to put on a small
plate at your side, and your supply of food is completed, with the addition of
all the bread you want. You mix all the things you have in your large soup-
plate into a thick mass, like yellow paste, and eat with a spoon.
A LITTLE TOO PEPPERY.
"This is the famous Java curry; and if you have taken plenty of the pepper
and chutney, and other hot things, your mouth will burn for half an hour as
though you had drunk from a kettle of boiling water. And when you have
eaten freely of curry, you don't want any other breakfast. Everybody eats
curry here daily, because it is said to be good for the health by keeping the
liver active, and preventing fevers."
After breakfast our friends went to their rooms, and soon afterwards met on
the veranda to arrange plans for seeing Batavia. Somewhat to their surprise,
they learned that it was not fashionable to be seen out till three o'clock in the
afternoon, and they must not call on any one during the middle of the day.
The Doctor said that the Dutch and other foreign inhabitants of the city were
supposed to sleep two or three hours while the sun was high in the heavens;
but as they were strangers, and had little time at their disposal, they would
get a carriage and take a drive.
AFTER BREAKFAST.
Neither ladies nor gentlemen are visible in Batavia between breakfast and
three p.m.; or if they show themselves they are not acting according to
custom. They lounge in bed or hammock, or in their bamboo arm-chairs, and
try to get as much rest as possible to fit them for the fatigues of the evening.
It is this habit of sleeping in the daytime that enables the fashionable
Batavians to keep very late hours. They are accustomed to rise early; and by
five o'clock in the morning half the people in the hotel were out of bed, and
the rest of them before six.
Frank and Fred were awakened on their
first morning in Batavia before they
thought the hour of rising had arrived.
The Doctor told them they had best
conform to the custom, and so they crept
from their beds and prepared to dress.
"That is unnecessary," said the Doctor; "it
is perfectly proper for you to come out in
your sleeping-suits, and sit in front of
your rooms, or go to your baths. You will
find that is what everybody else is doing."
AN EARLY CALL.
Accordingly they made their appearance
in their pajamas, and found that the
servant was ready to attend upon them. All around they could hear men
calling "api!" "api!" and they naturally asked what "api" meant.
"It is the Malay word for 'light' or 'fire,'" said the Doctor; "and the call you
hear is for a light for a cigar or cigarette."
When they went to the row of bath-rooms fronting their apartments, the boys
looked for bathing-tubs, but found none. Each bath-room had a faucet
whence water could be drawn, or it contained a barrel and a dipper, but no
other furniture.
The bathing custom in Java is to pour water over the body, and not to plunge
into a tub. A tub can be had by any one who asks for it; but he runs the risk
of being considered a barbarian, who cannot be weaned from the absurd
customs of his native land.
After the bath came the "little breakfast," as it is called by the residents,
consisting of tea or coffee, with eggs or cold meat, and a few biscuits. When
this was ended Doctor Bronson ordered a carriage, and the morning hours
were devoted to a drive.
"We have not quite time," said the Doctor, "to exhaust a single course with
the carriage between this and the hour for the rys taffel."
The boys could not understand his meaning, until he explained that the rules
governing the hire of carriages in Batavia are somewhat curious. "The tariff
for a Victoria," said he, "is four florins or guilders—about one dollar and sixty
cents of our money, and if you only ride a few blocks you must pay that price.
But you can, if you choose, keep it for six hours without any extra charge,
except that the driver will expect an allowance of an hour or so to rest his
horses, and a little money for himself by way of remembrance."
"What an odd arrangement!" said Frank.
Fred agreed with him fully, and probably every traveller who visits Batavia will
not be long in coming to the same conclusion.
"When I was here before," continued the Doctor, "I took a carriage one
morning for the customary six hours, and went out for a drive. At the end of
three hours I returned to the hotel for breakfast, and told the driver he could
have an hour to himself and then return. He did not come again, and when I
asked at the office of the hotel the manager said he would investigate the
affair. In the evening he told me he had seen the driver, and paid him, and his
reason for not returning was that his horses were tired.
"I thought no more of the matter till I settled my bill the next day, preparatory
to going into the country, and found that the full tariff of four guilders had
been charged for the carriage. I protested that the man was not entitled to
that amount, because he had not given me the stipulated service. The
manager said he had paid the bill because that was the law; and he added
that the driver would have served me the full time if his horses had not been
tired.
"In vain did I protest that I had been unjustly treated; the only answer I could
get from the manager was, 'The driver's horses were tired—his horses were
tired.' I vowed that the next time I employed a carriage in Batavia I would
adhere rigidly to the law, and keep it in my sight for the full six hours,
whether I wanted it or not. If the driver serves us well to-day, perhaps he will
get an allowance; but if he is obstinate, as these Malay drivers sometimes are,
I shall feel like enforcing the law to the letter."
They were fortunate in finding a very amiable driver, who did his best to make
the strangers enjoy their ride. He spoke only the Malay language; but, in spite
of the absence of a common tongue, he managed to make them understand
his explanations, and to show them a good deal of Batavia. The result was
that they gave him an hour to spare, and an extra florin for the trouble he
had taken.
Here is what Frank wrote in his note-book concerning their first morning's ride
in Batavia:
NATIVE HOUSE ON THE RIVER THAT
FEEDS THE CANAL.
"Batavia covers a great extent of ground, and is fairly entitled to be called a
city of magnificent distances. The old city near the sea is rather closely built,
but it is not inhabited by Europeans to any extent. The Dutch, English, and
other foreign merchants transact business there during the day; but they live
in the new part of Batavia, which spreads over the flat ground for several
square miles. The houses are rarely of more than one story, as the country is
subject to earthquakes, and nobody wants to have a flight of stairs between
him and the ground when these shakings begin. Nearly every house has a
campong, or yard, around it, and this yard is filled with tropical trees in
considerable variety. The great streets and roads are liberally provided with
shade-trees, so that Batavia can hardly be seen, owing to the impossibility of
peering through the dense foliage that is before you at every step.
"A canal with several branches runs through all this level area that they call
Batavia, and for miles and miles it is built up with solid stone walls. It is fed by
a small river coming down from the mountains, and serves a triple purpose:
boats may navigate it; people may bathe there, or wash clothes in it; and the
sewage of the city is said to be drained into it. Whether the water for
household use is taken from it or not, I am unable to say; but we repeatedly
saw Malay servants filling buckets with it, and then walking off in the direction
of the houses. Circumstantial evidence was against them; but the clerk of the
hotel says the water they were carrying was to be used for washing the floors
of the houses and sprinkling the gravel-walks in the court-yards. Perhaps it is
the suspicion that the water may be used for drinking purposes that leads so
many of the inhabitants to shun it, and take seltzer, gin, claret, and other
imported liquids to quench their thirst.
"They have a street railway here, but it is patronized only by the natives, the
Chinese, and the low class of foreigners. The track is good enough, but the
cars are the wildest contrivances you ever saw; they are common freight-cars
fitted with rush seats, and their great weight makes them difficult to move
along the way. Perhaps, if they had the proper kind of cars, the Europeans
would ride in them, but they could hardly expect to patronize those now in
use.
"It was a funny sight, when we were driving along the streets, to see the
ladies out for their morning promenade, with their hair streaming down their
shoulders, their bodies enclosed only in light wrappers, with loose sacks
buttoned to the throat, and with slippers, but no stockings, on their feet. Most
of them wore the sarong, or native petticoat, and they generally carried
parasols to keep off the sun. This is the forenoon costume of the ladies before
they go to breakfast, and it strikes a foreigner as very odd.
FAMILY PARTY IN BATAVIA.
"Sometimes we saw a whole family sitting on the veranda of a house, in full
view of everybody passing along the street, looking as if they had just got out
of bed and were only half dressed. The men would be in dressing-gowns or
pajamas, and the ladies with their hair down, as I have described, or twisted
up into tight little lumps, so that the owners might appear in the afternoon
with a fine stock of curls. Occasionally we saw some fat, jolly old women with
their hair cut close to the head, in order to keep off as much of the heat as
possible.
FAN-PALM IN THE BOTANICAL GARDEN.
"We visited the museum and the botanical garden, and found them quite
interesting. The museum contains the products of Java, arranged so that you
can readily see what the resources of the island are; and there are relics of
ancient times that throw light upon the history of the country and its people.
The botanical garden abounds in tropical plants, and reminded us of the
garden at Singapore; but we had not time to make a list of its contents. We
saw some fine specimens of a tree that had already attracted our attention at
Singapore—the 'fan-palm,' or traveller's fountain, as it is called. It spreads out
like a huge fan, with the lower part of the stalks quite bare, while the ends
are formed exactly like feathers. A small tree of this species would make a
very good fan for a giant, such as we read of in Gulliver's travels.
CHINESE PORTERS.
"In the old part of Batavia we saw so many Chinese that it would not have
required a great stretch of the imagination to believe that we were once more
in the Flowery Kingdom. In one of the narrowest streets we met a couple of
Chinese porters carrying a burden suspended from a pole, the same as we
had seen them in Canton and Shanghai, and if it had not been that our driver
was very careful we might have run over them. The Chinese are very
numerous in Batavia, and all through Java, and a great deal of the commercial
business of the country is in their hands. They are engaged in all kinds of
trade where money is to be made, and they have the same guilds and
commercial associations that they have in Singapore, Hong-kong, and
elsewhere. They have their temples and idols just as at home; and though
many of them were born in Java, and will probably never see the soil of
China, they are as thoroughly Chinese as though they were reared within the
walls of Canton.
GODDESS OF SAILORS AND HER
ASSISTANTS.
"One of the most common of the Chinese temples is that of the goddess 'Ma-
Chu,' who is worshipped by sailors and those having business on the water.
She is represented with her two assistants; one of them is called 'Favorable-
Wind-Ear,' and the other 'Thousand-Mile-Eye.' The first is supposed to have an
ear that can catch the least indication of a wind to favor the sailor; and the
latter possesses a clearness of vision that enables him to see a rock or other
danger at the distance of a thousand miles. One listens, while the other looks;
and between them they are believed able to insure a safe and speedy voyage
to all their worshippers."
As our friends were somewhat wearied with their morning's work, they
remained in-doors from the time of the "rys-taffel" till three o'clock. Then they
followed the custom of the country by taking a bath, and dressing for dinner;
and after dinner they continued to be in fashion by taking another drive. We
will let Fred tell the story of what they saw in the afternoon and evening.
"The fashionable hour for a promenade is after dinner, and all the ladies and
gentlemen consider it their duty to come out and be seen. There are plenty of
carriages on the streets, and also a goodly number of gentlemen on
horseback; and it is rather a pretty sight to see the gentlemen riding along by
the carriages and chatting with the ladies inside. Then there are many
pedestrians—the ladies being in light walking-dresses, and the gentlemen in
full evening costume. The odd thing about the promenades is that both sexes
are bareheaded. This is all well enough for the ladies; but it is rather strange
to see a gentleman in full dress, and carrying a cane along the street, with his
head as bare as though he was in a parlor. I am told that the ladies never
wear hats or bonnets, and that the only thing of that sort ever seen in Batavia
is when foreigners first arrive here from other parts of the world. A ladies' hat-
store in Batavia would not be a paying speculation.
"On certain evenings there is music on the King's Square; and at such times
everybody goes there to hear it. The crowd is large but very fashionable, as it
is the proper thing to go there; and no one who can get out will venture to
miss the performance. The band stops playing a little after dark, and then the
drive may be said to be at its prettiest. The footman of each carriage carries a
torch made of some resinous plant tied into a bundle, like a wisp of straw,
and, as the carriages move around and pass and repass each other, the scene
is a curious one. All the houses are a blaze of light, as the wide verandas are
hung with lamps, and the whole family is gathered there when not out for the
drive. The veranda is the general sitting-room, as everybody prefers it to the
parlor on account of its being so much cooler.
"Perhaps you are wondering when the men find time for business. Well, they
transact most of it in the forenoon, but their offices are open in the afternoon
in charge of the clerks. For the clerks there is no such resting-time as I have
described, or at best, only a short one, in the middle of the day. When a
young man comes out here to seek his fortune, he must do pretty much as he
would at home for the first year or two; when he is fairly established, he can
have his time in the middle of the day, and live like other people."
CHAPTER XXVI.
BATAVIA TO BUITENZORG.—TROPICAL SCENES.—
BIRDS OF PARADISE.
As their time in Java was limited, our friends determined to cut short their
stay in Batavia, and go at once to the interior. Accordingly, the morning
following the day whose history was narrated in the last chapter saw them
leaving the city by railway for Buitenzorg.
Buitenzorg is about forty miles from Batavia, and the summer residence of the
Governor-general of Java; as it is summer all the year round in Java, he
spends most of his time at this country-seat, and rarely visits Batavia except
when business calls him there. The name is of Dutch origin, and signifies
"without care," in imitation of the French Sans Souci. It is about one thousand
feet above the level of the sea, and much cooler than Batavia; and the
surrounding region is one of great natural beauty.
Doctor Bronson and his young companions were early at the railway-station,
and purchased their tickets for the journey. They found three classes of
carriages on the road; the first and second being patronized by foreigners,
and the third class exclusively by natives and Chinese. For their first-class
tickets they paid six florins and thirty cents—equal to two dollars and a half of
our money. The second-class ticket costs half as much as the first, and the
third half as much as the second, so that the natives are able to ride for about
a cent and a half per mile. The third-class carriages were crowded to such an
extent that Frank and Fred both remarked that the Javanese were as prompt
as the Japanese to recognize the value of the railway. Men and women were
closely packed on the rough seats of the carriages of the third class, while
those in the first and second, especially the former, had plenty of room.
"I suppose this is so the world over," said Fred, as he contemplated the
difference between the accommodations of the various classes on the train.
"Everywhere we have been, at any rate," responded Frank.
"Whatever accommodations you wish and can pay for," said the Doctor, "you
can have. If you want a special train at the price they demand, you can have
it by paying in advance."
"It is the same in Java as in Europe, and, to
a certain extent, we have similar
arrangements in America. We are more
democratic in our ways than any other
country of importance, and consequently
have been slower to make the distinctions
in railway travel that exist in other parts of
the world. But we are steadily moving in
that direction, and in time we will have all
the distinctions of classes—special trains
and all. In fact, we have them already."
"Aren't you mistaken, Doctor?" said Fred.
"Surely we do not have three classes on
our railways at home."
"Stop and think a moment," answered the
Doctor, while there was a suggestion of a
smile about his face. "We have the ordinary
SOME OF THE THIRD-CLASS railway carriage and the Pullman car, have
PASSENGERS. we not?"
"Certainly," was the reply; "and they are
virtually two classes."
"Quite right. Then, on the principal lines of railway there are the emigrant
trains, are there not?"
Fred acknowledged that the Doctor had the best of the argument, and the
conversation came to an abrupt termination, as it was time for them to take
their places in the carriage.
Away they started for their first ride on a railway-train south of the equator.
The suburbs of the city were speedily passed, and then the train plunged into
a tropical forest. The grade became steep as the hilly ground was reached,
and two locomotives were necessary for a part of the way to pull the train up
the heavy incline. Frank observed that the carriages were quite narrow, and
he found by measuring, at the first station where they stopped, that the rails
were only three and a half feet apart. The present terminus of the line is at
Buitenzorg; but surveys have been made, and it is the intention to push the
line forward and form a connection with the system of railway in the eastern
part of the island. When this is done, a stranger will be able to travel the
whole length of Java by rail, as he can now travel by wagon road.
VIEW IN A PRIVATE GARDEN.
Since the railway from Batavia to Buitenzorg was opened several villages have
sprung into existence along the line, and some of them are quite pretty. They
contain the residences of gentlemen whose business is at Batavia, and are
generally arranged with excellent taste. The gardens are luxuriant, like nearly
all gardens in the tropics; and some of the owners delight in adding wild
animals to their collections of trees and plants.
"MANGOSTEENS!"